Home » RDBMS Server » Server Utilities » SQL Loader Control File - User Name / User ID : How to get it
SQL Loader Control File - User Name / User ID : How to get it [message #250980] Thu, 12 July 2007 02:07 Go to next message
Mauragon
Messages: 20
Registered: February 2007
Location: Philippines
Junior Member
Hello.

I'm creating an SQL Loader control file which is registered and run under Oracle Apps 11i.

I was wondering if there's a way to get the username or user_id of the logged in user and insert that information to the target table?

I have included 2 columns for the target table

creation_date
created_by

filling up creation_date is easy with the SYSDATE keyword

but what about created_by? is USERNAME the answer?

Thanks in advance.

Re: SQL Loader Control File - User Name / User ID : How to get it [message #250991 is a reply to message #250980] Thu, 12 July 2007 02:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
USER

Regards
Michel
Re: SQL Loader Control File - User Name / User ID : How to get it [message #250992 is a reply to message #250980] Thu, 12 July 2007 02:29 Go to previous messageGo to next message
Mauragon
Messages: 20
Registered: February 2007
Location: Philippines
Junior Member
Merci, Michel
Re: SQL Loader Control File - User Name / User ID : How to get it [message #251864 is a reply to message #250980] Tue, 17 July 2007 00:39 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Mauragon wrote on Thu, 12 July 2007 13:07
Hello.

I'm creating an SQL Loader control file which is registered and run under Oracle Apps 11i.

I was wondering if there's a way to get the username or user_id of the logged in user and insert that information to the target table?

SQL> select username, user_id,created from user_users;

USERNAME                          USER_ID CREATED
------------------------------ ---------- ---------
ARJU                                   58 11-JUL-07






Re: SQL Loader Control File - User Name / User ID : How to get it [message #251896 is a reply to message #251864] Tue, 17 July 2007 02:00 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select user from dual;
USER
------------------------------
MICHEL

1 row selected.

The USER built-in function is there to give you your name. Smile

Regards
Michel
Re: SQL Loader Control File - User Name / User ID : How to get it [message #251910 is a reply to message #251896] Tue, 17 July 2007 02:27 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

Michel Cadot wrote on Tue, 17 July 2007 13:00
SQL> select user from dual;
USER
------------------------------
MICHEL

1 row selected.

The USER built-in function is there to give you your name. Smile

Regards
Michel



I could not understand this reply. I just wanted to mention the alternative way to get user...

Another is

SQL> show user;
USER is "SYS"

Re: SQL Loader Control File - User Name / User ID : How to get it [message #251940 is a reply to message #251910] Tue, 17 July 2007 03:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
The question was about SQL*Loader.
You can't execute your SQL query in SQL*Loader.
You can't exexute "show user" which is a SQL*Plus command in SQL*Loader.

Regards
Michel
Re: SQL Loader Control File - User Name / User ID : How to get it [message #252636 is a reply to message #250980] Thu, 19 July 2007 08:47 Go to previous message
nishav
Messages: 2
Registered: July 2007
Junior Member
Assign "FND_GLOBAL.user_name" to the variable created_by. This will give the name of the user who will submit the SQL Loader request.
Previous Topic: granting export rights
Next Topic: Multiple queries with expdp
Goto Forum:
  


Current Time: Sat Dec 10 18:48:19 CST 2016

Total time taken to generate the page: 0.08765 seconds