If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Help with control file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-17-05, 05:41
shatishr shatishr is offline
Registered User
 
Join Date: Aug 2005
Location: Kuala Lumpur, MY
Posts: 108
Red face Help with control file

Data:
------
10/10/2005 00:00:02 modbalrel - ok (msisdn = 60163050499, amount=1000, val_period = 7, seq_nb = 199370643 , balance = 1055, va
ldate = 08/11/2005) (48 ms)

10/10/2005 00:00:03 modbalrel - ok (msisdn = 60162433164, amount=1000, val_period = 7, seq_nb = 199370644 , balance = 987, val
date = 03/11/2005) (133 ms)
------

this is the ctrl file i written :
Load DATA
INFILE '/app/ITRAKPI/TRAP/TRAP_LOAD/TRAP_20051005.txt'
APPEND INTO TABLE trap_ra_k2_ain_balance
FIELDS TERMINATED BY ","
(
DATE_LOADED "(SELECT sysdate FROM dual)",
WEEK_NO "(sELECT to_char(sysdate,'WW') FROM dual)",
RELOAD_DATE position(01:10),
MSISDN position(46:56),
NEW_BALANCE
RELOAD_AMOUNT
)


Guys,
I want to load this file into my oracle database and the last two columns should be uploaded with this data

NEW_BALANCE, RELOAD_AMOUNT
balance = 1055,amount=1000
balance = 987,amount=1000
(IN WHICH i must specify from a space untill the field separator ',') and im not sure how to do it... I cant specify a position because the spaces are different and it accidentally takes the other values into the column...

anyone can help me ??
pls do not give me hints since its urgent....

and anyone could help me write a .sh file for this to find sysdate-1 and load

plssssssss
Reply With Quote
  #2 (permalink)  
Old 10-19-05, 09:31
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Thumbs down


D U P L I C A T E P O S T


__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On