Connecting Tech Pros Worldwide Help | Site Map

Variables in SQL Loader

  #1  
Old April 7th, 2009, 03:58 AM
Member
 
Join Date: Sep 2007
Posts: 55
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
  #2  
Old April 15th, 2009, 04:36 PM
Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 141

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."
  #3  
Old April 15th, 2009, 06:19 PM
Member
 
Join Date: Sep 2007
Posts: 55

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
  #4  
Old April 17th, 2009, 02:26 PM
Saii's Avatar
Expert
 
Join Date: Apr 2007
Posts: 141

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Download the JAVA , .NET and SQL Server interview with answers Jobs answers 2 September 26th, 2006 02:25 PM
Download the JAVA , .NET and SQL Server interview PDF Jobs answers 0 September 17th, 2006 02:05 PM
Win XP: Problem with shell scripting in Python A.M answers 10 June 12th, 2006 04:15 PM
Inserting multiple rows in sqlplus Raj Kotaru answers 4 July 19th, 2005 10:33 PM