Home » SQL & PL/SQL » Client Tools » How to find username in sqlplus?
How to find username in sqlplus? [message #519715] Tue, 16 August 2011 08:06 Go to next message
karthikperumal
Messages: 7
Registered: July 2011
Location: Chennai
Junior Member
Hi Friends,

How to find user name in sqlplus?

Regards,
KP
Re: How to find username in sqlplus? [message #519716 is a reply to message #519715] Tue, 16 August 2011 08:07 Go to previous messageGo to next message
Michel Cadot
Messages: 59993
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> show user
USER is "MICHEL"

Regards
Michel
Re: How to find username in sqlplus? [message #519717 is a reply to message #519716] Tue, 16 August 2011 08:17 Go to previous messageGo to next message
karthikperumal
Messages: 7
Registered: July 2011
Location: Chennai
Junior Member
Hi Micheal,

I am using Oracle 10G XE version and its giving the following error:

ORA-00900: invalid SQL statement

Appreciate your help in solving this error.

Regards,
KP
Re: How to find username in sqlplus? [message #519719 is a reply to message #519717] Tue, 16 August 2011 08:26 Go to previous messageGo to next message
Michel Cadot
Messages: 59993
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Copy and paste your session as I did it.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Re: How to find username in sqlplus? [message #519769 is a reply to message #519719] Tue, 16 August 2011 14:32 Go to previous messageGo to next message
Littlefoot
Messages: 19889
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I suppose that this is because the OP runs statements in 10g XE's SQL Workshop window. As "SHOW" is a SQL*Plus command, it won't work there. So, either move to classic SQL*Plus, or try with something like
SELECT SYS_CONTEXT('USERENV', 'SESSION_USER') FROM DUAL;
Re: How to find username in sqlplus? [message #519770 is a reply to message #519769] Tue, 16 August 2011 15:09 Go to previous message
Michel Cadot
Messages: 59993
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maybe but the question is clearly "How to find user name in sqlplus", so if OP asks the wrong qurestion he could not expect to get the appropriate answer for the real question. Smile

Regards
Michel
Previous Topic: Please help me all you specialist!(3 Merged)
Next Topic: Unexpected Error - Feed Back
Goto Forum:
  


Current Time: Fri Dec 19 19:08:38 CST 2014

Total time taken to generate the page: 0.08845 seconds