Home » RDBMS Server » Server Utilities » SQL*LOADER
icon6.gif  SQL*LOADER [message #128107] Fri, 15 July 2005 02:56 Go to next message
vartul_arora
Messages: 4
Registered: July 2005
Junior Member
How do I pass a piece of text to the loader file that needs to be stored in the database. This text will change every time I run the loader and I do not have the liberty to hard code this value in the ctl file before every run. The process needs to be automated.

I am working in Unix env. One possible solution can be to set an env variable with the text value and let the control(dot ctl) file access this shell variable.

But dunno how to do this or is it possible ?
Re: SQL*LOADER [message #128115 is a reply to message #128107] Fri, 15 July 2005 03:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
what is this 'piece of text'?
is this stored in the same table as being loaded or different.
Post the ddl of table,sample data file and your 'piece of text'.
Re: SQL*LOADER [message #128119 is a reply to message #128107] Fri, 15 July 2005 03:56 Go to previous messageGo to next message
vartul_arora
Messages: 4
Registered: July 2005
Junior Member
flatfile.dat ---> ddd.ctl ---> loader ----> into the table, xyz.

Need to pass "flatfile.dat" (the piece of text, that will change everytime I run the process) to the ddd.ctl that will in turn store "flatfile.dat" as varchar into xyz.filename column.

Re: SQL*LOADER [message #128149 is a reply to message #128119] Fri, 15 July 2005 06:54 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
See whether this helps.
Else , Please let us know.

http://www.orafaq.com/forum/t/12234/0/
Re: SQL*LOADER [message #128528 is a reply to message #128149] Tue, 19 July 2005 03:54 Go to previous messageGo to next message
vartul_arora
Messages: 4
Registered: July 2005
Junior Member
Mahesh, the solution you gave works if I hard code the file name in the sample.ctl every time before I run the sqlldr.

What I am looking for is a way with which I do not have to hard code the file name. The file name is to be picked automatically.

Thanks,
Atul
Re: SQL*LOADER [message #128556 is a reply to message #128528] Tue, 19 July 2005 07:00 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Did you really go through that script?
You are not hardcoding the fileName.
Every you invoke the sqlldr you are passing the filename as input.
The control file is created on the fly for every load.
thats it.
If you dont want the filename as input, then use the same mechanisms to grep the filename from control file.
Re: SQL*LOADER [message #129126 is a reply to message #128556] Fri, 22 July 2005 01:48 Go to previous message
vartul_arora
Messages: 4
Registered: July 2005
Junior Member
Yes, I did went through the script. And in the second pass I did realized the mistake I was doing. It works

Thanks for the help.

Regards,
Atul Arora
Previous Topic: import a csv file into Oracle DB using SQl loader in Unix environment
Next Topic: Newbie: SQL*loader: ORA-01722
Goto Forum:
  


Current Time: Wed Jul 03 08:37:47 CDT 2024