Thread: Using Variables in SQL*Loader
08-11-04, 11:37 #1Registered User
- Join Date
- Aug 2004
Unanswered: Using Variables in SQL*Loader
I am loading some files with the first twelve positions of each record containing the key value.
When generating the file to be loaded into the database, the programmer starts with 1 for the key value and increments by one.
My situtation is that I need to override what the programmer plugs into the key with a beginning value for the first record being loaded, (and incrementing by 1 for each subsequent record).
I have done this with SQL Server and had a variable at the beginning of the script that I would put the beginning key and it would automatically increment by one for each subsequent record loaded. However, it's been awhile and I don't have an example and imagine if it can be achieved in SQL*Loader, it is probably different.
Any guidance with this is appreciated.
08-11-04, 13:33 #2Registered User
- Join Date
- Jun 2003
- West Palm Beach, FL
Use RECNUM in SQL*Loader control fie like:
load data infile 'MyFile.dat' into table ... (... , colx RECNUM)The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb