Home » RDBMS Server » Server Utilities » SQL LOADER (Oracle 10g)
SQL LOADER (Oracle 10g) [message #322663] Sun, 25 May 2008 20:43 Go to next message
icebox_xxx_13
Messages: 7
Registered: May 2008
Location: Philippines
Junior Member
Hi all!

Does anyone know how to load dynamic filename?

Thanks!
Re: SQL LOADER (Oracle 10g) [message #322664 is a reply to message #322663] Sun, 25 May 2008 20:46 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>Does anyone know how to load dynamic filename?
via environmental variable?
Re: SQL LOADER (Oracle 10g) [message #322665 is a reply to message #322663] Sun, 25 May 2008 21:03 Go to previous messageGo to next message
icebox_xxx_13
Messages: 7
Registered: May 2008
Location: Philippines
Junior Member
in the INFILE part, i want to load a filename which is generated everyday. for example today:

LOAD DATA
INFILE 'SAMPLE20080526.dat'
APPEND INTO TABLE stage_students
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
(student_no)



the filename "SAMPLE20080526" consist of the word SAMPLE and system date which is 20080526 or 2008-05-26.

thanks!

[Updated on: Sun, 25 May 2008 21:03]

Report message to a moderator

Re: SQL LOADER (Oracle 10g) [message #322666 is a reply to message #322663] Sun, 25 May 2008 21:08 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
The filename does NOT have to be in the control file.
It can exist on the command line.

imp file=$TODAYS_DATA
Re: SQL LOADER (Oracle 10g) [message #322669 is a reply to message #322663] Sun, 25 May 2008 21:35 Go to previous messageGo to next message
icebox_xxx_13
Messages: 7
Registered: May 2008
Location: Philippines
Junior Member
what is imp file. is it a variable or one of the parameters of sqlldr command?
Re: SQL LOADER (Oracle 10g) [message #322676 is a reply to message #322669] Sun, 25 May 2008 22:02 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
SQL*Loader Command-Line Reference.
Re: SQL LOADER (Oracle 10g) [message #322681 is a reply to message #322663] Sun, 25 May 2008 22:15 Go to previous messageGo to next message
icebox_xxx_13
Messages: 7
Registered: May 2008
Location: Philippines
Junior Member
@ebrian

it's still not a solution to my problem.
Re: SQL LOADER (Oracle 10g) [message #322682 is a reply to message #322663] Sun, 25 May 2008 22:18 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>it's still not a solution to my problem.
Yes, it IS a solution to your problem.

How do you get data into a file named 'SAMPLE20080526.dat'?

Some folks are clue resistant; while others are clue repellent.

[Updated on: Sun, 25 May 2008 22:19] by Moderator

Report message to a moderator

Re: SQL LOADER (Oracle 10g) [message #322684 is a reply to message #322681] Sun, 25 May 2008 22:54 Go to previous message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
If running from SQL*Plus:

COLUMN sample_and_date NEW_VALUE filename
SELECT 'SAMPLE' || TO_CHAR (SYSDATE, 'YYYYMMDD') AS sample_and_date
FROM DUAL
/
HOST SQLLDR scott/tiger CONTROL=test.ctl LOG=test.log DATA=&filename..dat
Previous Topic: SQL LOADER
Next Topic: Inserting fixed length data without delimeter
Goto Forum:
  


Current Time: Sat Dec 10 20:52:29 CST 2016

Total time taken to generate the page: 0.05568 seconds