Thread: Parameters / Variables in SQL Loader Control File

This question is answered.


Permlink Replies: 3 - Pages: 1 - Last Post: Jul 3, 2009 4:04 AM Last Post By: Chester Tan
Chester Tan

Posts: 4
Registered: 07/03/09
Parameters / Variables in SQL Loader Control File
Posted: Jul 3, 2009 1:33 AM
 
Click to report abuse...   Click to reply to this thread Reply
Here's my problem, I have created SQL Loader control file (ctl) to load a file of employees. This loader program is registered in Oracle Applications. What I want is to pass a parameter derived from the profile like the user name of the one who executed the loader program and pass it to the loader program so that the user name info is included in the loading

example

input data
123456,John,Smith
654321,Jane,Doe

loaded data
123456,John,Smith,03-JUL-2009,USER13
654321,Jane,Doe,03-JUL-2009,USER13

the sysdate is easy because it can be defined in the column but what I really want to achieve is a parameter passed to the ctl file.

Thanks in advance.
virendra.k

Posts: 902
Registered: 10/16/06
Re: Parameters / Variables in SQL Loader Control File
Posted: Jul 3, 2009 2:04 AM   in response to: Chester Tan in response to: Chester Tan
Correct
Click to report abuse...   Click to reply to this thread Reply
Hi,
It is not easy to pass arguments to control file all that you can do is change the controlfile by file writing option for your parameter dynamically. If the user is database user then you can place USER as keyword as you are doing to store sysdate.

Thanks.
Florian W.

Posts: 1,203
Registered: 01/17/07
Re: Parameters / Variables in SQL Loader Control File
Posted: Jul 3, 2009 2:10 AM   in response to: Chester Tan in response to: Chester Tan
Helpful
Click to report abuse...   Click to reply to this thread Reply
Dear user!

Please have a look at this thread.

Need small help

In the last three posts I explain how to use a shellscript with AWK and SED to pass parameters to a controlfile.

Please feel free to post again if you have some questions regarding my explanatory notes.

Yours sincerely

Florian W.
Chester Tan

Posts: 4
Registered: 07/03/09
Re: Parameters / Variables in SQL Loader Control File
Posted: Jul 3, 2009 4:04 AM   in response to: Chester Tan in response to: Chester Tan
 
Click to report abuse...   Click to reply to this thread Reply
Thanks guys. I guess I have to assign a constant to the column

Thanks for your replies.
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums