dbTalk Databases Forums  

Read username from OS

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Read username from OS in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kiko
 
Posts: n/a

Default Read username from OS - 02-11-2004 , 06:06 AM






Hi,
sorry for my english.

I have a Developper application running on Windows2000, in a net.

The users must introduced username/password to connect to the application.

Well, I want to read de Operating System variable "USERNAME", so the users
don´t must introduced username/password.
I can´t forget de username, to assign diferent profiles.

Anybody can help me?

Thanks.
-------------

¡Hola!
Tengo una aplicación con Developer sobre Windows 2000.
Los usuarios deben validarse introduciendo el usuario/password al conectarse
a la aplicación.
Quiero evitar que los usuarios introduzcan nuevamente el usuario/password,
cuando ya se han identificado al conectarse a la red.
Para ello, se me ocurre que puedo leer la variable del sistema "USERNAME".
No puedo prescindir del USERNAME pues dependiendo del usuario le asigno uno
u otro perfil.

¿Alguien puede ayudarme?

Muchas gracias.



Reply With Quote
  #2  
Old   
Sybrand Bakker
 
Posts: n/a

Default Re: Read username from OS - 02-11-2004 , 02:06 PM






On Wed, 11 Feb 2004 13:06:36 +0100, "Kiko" <kiko (AT) terra (DOT) es> wrote:

Quote:
Anybody can help me?
Check out the sys_context function in the SQL reference manual.


--
Sybrand Bakker, Senior Oracle DBA


Reply With Quote
  #3  
Old   
Daniel Morgan
 
Posts: n/a

Default Re: Read username from OS - 02-11-2004 , 02:49 PM



Sybrand Bakker wrote:

Quote:
On Wed, 11 Feb 2004 13:06:36 +0100, "Kiko" <kiko (AT) terra (DOT) es> wrote:


Anybody can help me?


Check out the sys_context function in the SQL reference manual.


--
Sybrand Bakker, Senior Oracle DBA
SYS_CONTEXT function information can be found at
http://tahiti.oracle.com and at http://www.psoug.org/reference/library.html.

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
http://www.outreach.washington.edu/e...oa/aoa_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)



Reply With Quote
  #4  
Old   
Kiko
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 02:40 AM



Only valid for Oracle 9.2 and latter versions?
My D.B. server has Oracle 8.0.6 versión.
I try to run:
SELECT sys_context('USERENV', 'USERNAME')
FROM dual;

with error.

----

¿Esta función solo es válida para la versión 9.2 de Oracle, y posteriores?
Mi servidor Oracle tiene la 8.0.6.

Intenté ejecutar :
SELECT sys_context('USERENV', 'USERNAME')
FROM dual;

dándome error.



Reply With Quote
  #5  
Old   
Bricklen
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 09:16 AM



Kiko wrote:

Quote:
Only valid for Oracle 9.2 and latter versions?
My D.B. server has Oracle 8.0.6 versión.
I try to run:
SELECT sys_context('USERENV', 'USERNAME')
FROM dual;

with error.

----

¿Esta función solo es válida para la versión 9.2 de Oracle, y posteriores?
Mi servidor Oracle tiene la 8.0.6.

Intenté ejecutar :
SELECT sys_context('USERENV', 'USERNAME')
FROM dual;

dándome error.


first try it with:

SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;
I don't think 'USERNAME' is a valid option.

If that doesn't work, then check out:
http://download-west.oracle.com/docs.../doc/index.htm
and look for userenv

There aren't too many options for that one though.


Reply With Quote
  #6  
Old   
Bricklen
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 09:18 AM



Bricklen wrote:
Quote:
first try it with:

SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;
I don't think 'USERNAME' is a valid option.

If that doesn't work, then check out:
http://download-west.oracle.com/docs.../doc/index.htm
and look for userenv

There aren't too many options for that one though.
Alternatively, try it with OS_USER if that's what you're looking for:

SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual;


Reply With Quote
  #7  
Old   
Niall Litchfield
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 09:28 AM



I don't believe that sys_context was valid back in 8.0.6, just USERENV.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Bricklen" <bricklen-rem (AT) yahoo (DOT) comz> wrote

Quote:
Bricklen wrote:

first try it with:

SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;
I don't think 'USERNAME' is a valid option.

If that doesn't work, then check out:
http://download-west.oracle.com/docs.../doc/index.htm
and look for userenv

There aren't too many options for that one though.

Alternatively, try it with OS_USER if that's what you're looking for:

SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual;



Reply With Quote
  #8  
Old   
Bricklen
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 10:36 AM



Kiko wrote:

Quote:
It doesn't work.


userenv doesn't work? Bit more specific please.


Reply With Quote
  #9  
Old   
Kiko
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 10:44 AM



SQLWKS> SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;
SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual
*
ORA-00904: nombre de columna no válido - I translate : (Column name not
valid)
SQLWKS>
SQLWKS> SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual;
SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual
*
ORA-00904: nombre de columna no válido




Reply With Quote
  #10  
Old   
Bricklen
 
Posts: n/a

Default Re: Read username from OS - 02-12-2004 , 10:46 AM



Kiko wrote:

Quote:
SQLWKS> SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;
SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual
*
ORA-00904: nombre de columna no válido - I translate : (Column name not
valid)
SQLWKS
SQLWKS> SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual;
SELECT SYS_CONTEXT ('USERENV', 'OS_USER') from dual
*
ORA-00904: nombre de columna no válido



read the rest of my post (and Niall's) about USERENV, and follow the
link I provided you.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.