Identifying Data file
Chella, July 10, 2001 - 6:37 am UTC
The answer was helpful however, I am performing the upload using a control file which looks like;
LOAD DATA
INFILE 'c:\bsp\stmt.txt'
APPEND
INTO TABLE tblMailboxData
(
RecID SEQUENCE(MAX,1), -- To create a unique row id. Is this the correct syntax ?
CustSortCode POSITION(1:6),
CustAcNumber POSITION(7:14),
TransCode POSITION(16:17),
RemSortCode POSITION(18:23)
)
My data file name starts with 'cc', file extension is '001'. How do I replace the DATA= with INFILE ? Could you give me the correct syntax or point me to some materials ? Ta
Identifying Data file
Oliver DommackThoms, September 13, 2002 - 4:37 am UTC
Good Example, it even helps on those 'batch' Jobs where you don't know what files you get maybe via ftp.
I'm having an problem that's connected:
My files are deleted after insertion. In order to trace back where the data came from, I need the filename stored in the db as well!
Currently I'm woring with the .ctl as a variable in a Shell Skript which replaces the filename for the INFILE statement and as a CONSTANT for the db-input. That does solve my problem but is quite unaesthetic. ;-))
Is there a System/SQL Loader/Oracle variable where I can get the filename from if the Skript would instead simply execute a static .ctl with the DATA= parameter????
September 14, 2002 - 1:39 pm UTC
The shell replacement is the way to accomplish it. write the control file based on the filename and run it. Unaesthetic or not, its the way to get it done.
Identifying Data file
Kevin, September 08, 2005 - 8:24 pm UTC
Regarding, "write the control file based on the filename and run it",
In a production environment the user running the job doesn't have the privilege to be able to write out a control file on the fly.
What is the way to sqlload the name of the file being sqlloaded for a cron job or operator?
September 08, 2005 - 8:39 pm UTC
In a production environment the user running the job doesn't have the privilege
to be able to write out a control file on the fly.
why not?
that cron job can certainly write out the control file.
the operator can run a script that can certainly write out the control file.
that end user can certainly write out that control file.
why not?
Identifying Data file
Kevin, September 09, 2005 - 9:25 am UTC
The production directory where the control files are kept is owned by root and the group is a group that the cron user & operators don't belong to, and has read privilege for public:
drwxrwxr-x root qa
September 09, 2005 - 9:36 am UTC
so?
you would be writing the control file to /tmp or something and using it (it is a one time use control file)
Identifying Data file
Kevin, September 09, 2005 - 8:50 pm UTC
A wrapper script to sqlldr is used, which looks for the control file in that particular directory.
September 09, 2005 - 9:09 pm UTC
that means your process needs to change?