Home » RDBMS Server » Server Utilities » help me out
help me out [message #74074] Thu, 02 September 2004 04:54 Go to next message
subhasish
Messages: 33
Registered: May 2000
Member
I have a specific problem related to SQL*LOADER.. which I think should be very common... though I could able to find the solution..

HOST('d:OBINSQLLDR.EXE USERID=HRPAY/HRPAY CONTROL=D:EBIZHRPAYarsARS_test.TXT');

the above lines are from application(forms) or can be considered as command line.

ARS_test.TXT contains...........

load data
infile 'c:attendance.txt'
APPEND into table ATTN_REC_test
WHEN vc_date = '0907'
fields terminated by WHITESPACE TRAILING NULLCOLS
( VC_TYPE CHAR(1),
VC_CARD_NO CHAR(10),
VC_DATE CHAR(8),
VC_TIME CHAR(4))

So it will load data for which vc_date = '0907'(here '0907' means 09-> day 07 -> month)
It is not feasible for user to edit the vc_date each day and then fire the loading.
Is there any option as to pass the vc_date value at runtime. like example

WHEN vc_date = :date_value

:date_value will be passed from application or command line.

Thanks
Subhasish
Re: help me out [message #74075 is a reply to message #74074] Thu, 02 September 2004 07:07 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
for a simple and not so efficeint method(still works!), please look here
http://www.orafaq.com/forum/t/27006/0/

You can also use perl/sed or anyscripting for the same.

[Updated on: Fri, 18 February 2005 23:32]

Report message to a moderator

Re: help me out [message #74080 is a reply to message #74075] Fri, 03 September 2004 05:37 Go to previous message
subhasish
Messages: 33
Registered: May 2000
Member
Thanks Mahesh .. Since I am into 2000 server ....unix script won't do ..Though I could able to solve the problem by using simple text_io package.. at the application level to modify the control file at fly used by SQL*Loader.

Though the stated problem could have easily done by using staging table( ie. total insert into temp table and use pl/sql to get the required data from staging table to required table). Since I have a huge data to be loaded everyday I prefered the former one saving time and resource.

Thanks again..
Previous Topic: SQL *Loader (Challenging)
Next Topic: Export from 8i to 9i and then from 9i to 8i possiblibilty!
Goto Forum:
  


Current Time: Wed Dec 25 08:29:58 CST 2024