Connecting Tech Pros Worldwide Forums | Help | Site Map

Variables in SQL Loader

Member
 
Join Date: Sep 2007
Posts: 55
#1: Apr 7 '09
Hi All,
Can anyone kindly give me an approach to use a variable in a sql loader ctl file. I am trying to add the value before each insert of row and this value is the file name. So the question is how can I dynamically identify the input data file name, if not, is there a way I can make my SQL Loader to insert a value (file name) before each row into the table.
Regards,
Aj

Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 145
#2: Apr 15 '09

re: Variables in SQL Loader


Can you please elaborate some more -is this column not available in data file, at what position you want to insert,where to insert this row as you said "insert a value (file name) before each row into the table."
Member
 
Join Date: Sep 2007
Posts: 55
#3: Apr 15 '09

re: Variables in SQL Loader


Hi Saii, Thanks for your reply. What I am trying to accomplish here is, I want to insert the data file name along with other data in the data file into table X and this table has the file name coloumn, but the data file does not contain the file name as one of its contents.
Regards, Aj
Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 145
#4: Apr 17 '09

re: Variables in SQL Loader


You want to load the data file name into the table so I am guessing that for all the rows in that file, the name will be same. just from top of my head,i guess you can load this column as blank and issue an update statement just after loading the data in your script(assuming you are doing this in script).
If this is not helping can you provide a sample of the control file and explain your current approach of implementing this process.
Reply