|
|
Re: SQL LOADER (Oracle 10g) [message #322665 is a reply to message #322663] |
Sun, 25 May 2008 21:03 |
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 #322684 is a reply to message #322681] |
Sun, 25 May 2008 22:54 |
|
Barbara Boehmer
Messages: 9101 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
|
|
|