User name from PL/SQL

I'm using Oracle 10g
From a database procedure, how to select the current user name who is logged in

Venkadesh wrote:
sb92075Careless mistake :(You dont need to use SELECT also.. Just simply assign USER to variable (OP stated - in PL/SQL)
SQL> declare
  2   lc_user varchar2(30) := user;
  3  begin
  4   dbms_output.put_line(lc_user);
  5  end;
  6  /
DCA
PL/SQL procedure successfully completed.

Similar Messages

  • Dbanalyzer ERROR 25: SQLDBC error -4008, POS(1) Unknown user name/password combination (SQL state "28000").

    Hello Gurus,
    we have a unusual problem with our MaxDB 7.9.8.25
    We want to check the parameter like discribed in note 1111426, but dbanalyzer throws the following error.
    tttadm >/sapdb/TTT/db/bin/dbanalyzer -d TTT -u superdba,****** -f dbanalyzer_InstanceParameterCheck.cfg -o /tmp -i -c 1 -t 1,1
    SAP MaxDB Database Analyzer, The Performance Analysis Tool, Version 7.9.08.25
    Copyright 2000-2014 by SAP AG
    ERROR 25: SQLDBC error -4008, POS(1) Unknown user name/password combination (SQL state "28000").
    But with dbmcli we can connect with the same user.
    tttadm >  dbmcli -d TTT -u superdba,******
    dbmcli on KBP>
    Has anyone a suggestion?!

    Have you tried, if you can actually do SQL with that user? Maybe there is a problem with the SQL authorization?
    Does the following work for you?
    >sqlcli -d tz79 -u dba,dba select * from dual
    | DUMMY |
    | ----- |
    | a   
    1 row selected (1318 usec)
    dbmcli -d tz79 -u dba,dba sql_execute select * from dual
    OK
    END 'a'

  • We have an itunes account on our desktop and my kids have it on their ipod and iphone. I went in and changed our user name from my old e-mail address which is no longer accessible to my new one and now either of my kids can access the itunes store..

    We have an itunes account on our desktop and both my kids have it on iphone and ipod. I went in and changed out user name from an old e-mail address which is no longer accessible to my one I use now... When the kids try to sign onto the itunes store it tells them they have the wrong user name..
    Can this be fixed??

    Did you change the email address or create a new Apple ID?
    If the email address associated with the account was merely changed, sign out of the Apple ID on the devices and sign in using the new credentials.

  • How can I transfer two user names from an iMac to a new macbook?

    How can I transfer two user names from an iMac to a new macbook?
    got a new laptop and need to transfer two usernames to it, complete with all documents help?

    Assuming you haven't already set up a user, the easiest way is to use the Setup Assistant during first boot of the new Mac, with the two Macs connected by firewire.
    You'll be prompted to migrate from a choice of sources - choose "from another Mac", select the catagories of data you want to transfer and follow the instructions.
    More info here, in Pondini's FAQ; http://pondini.org/OSX/SetupAsst.html

  • How to retrieve user name from a given Subject?

    I am in a situation where I need to retrieve user name from the Subject that is populated when user logs in. I have the active Subject and I do following to get the principals in the subject and iterate through them:
    Set principals = subject.getPrincipals();
    Iterator ite = principals.iterator();
    while (ite.hasNext()) {
    Principal prin = (Principal)ite.next();
    String name = prin.getName();
    But this contains all the principals, including user name, roles, password, etc. How do I programmatically determine which one is user name?

    Don't you have different principal types? I am making a jaas module and I have different principals for roles, groups etc. I think of principals as attributes, the type in the attribute name and the principal name is the attribute value.
    To get all the principals of the type SomePrincipal, you can use:
    Set principals = subject.getPrincipals(SomePrincipal.class)
    You can also take som principal an test wether it is an instance of som type:
    if (Principal p instanceof SomePrincipal){..}
    An other solution which might be better if you have many different attributes is to store both attribute name and value in the name of the principal.
    If "mark" is a username the principal name will be "username:mark" el.
    Then it will be easy to find the username.

  • How to get the Users Name from the SSL certificate?

    Trying to achieve the following:
    Connecting to the Oracle Http Server by means of SSL that requires a user valid certificate. Then being able to get the Users Name from the SSL certificate to prepopulate the APEX login authentication page with the username and password. Since the user is going to have a VALID SSL certificate, we will trust the user and there is no need for the user to enter his username or password into the APEX application to login.
    Does SSO do this or something else?

    Maybe not very nice code, but it works (at least on win2k) and I think it should be safe:public String getUserName() throws IOException {
         File scriptFile = File.createTempFile("script", ".js");
         FileWriter fw = new FileWriter(scriptFile);
         fw.write ("WScript.Echo(WScript.CreateObject('WScript.Network').UserName)");
         fw.flush();
         fw.close();
         BufferedReader br = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("CSCRIPT.EXE \"" + scriptFile + "\" //Nologo").getInputStream()));
         String uName = br.readLine();
         br.close();
         scriptFile.delete();
         if (scriptFile.exists()) scriptFile.deleteOnExit();
         return uName;
    }

  • How to get the system property - user.name from a client system

    Hi All,
    I have an application which would enable active users from the domain of the company. I want to get the name of the client from the system. I tried to run it on the local machine from Jdeveloper, it returned me the correct user name. But when the application is deployed on the Oracle Application server, and i hit the URL of the application, it returns the server URL.
    I understand that the JSP works on the server side here but help me out to get a solution. I want to read the user name from the client side.
    Thanks in advance!
    Akhil

    Akhil,
    I hope this will never work. Think about your requirement for a second....
    This would mean an application is able to see my user credentials without my knowledge. It's bad enough the know my IP if I'm not using TOR.
    To get your requirement to work you have to redefine it a bit. The user have to log in to your application. The application holds the name together with an ID of the session to know the user in further requests.
    Thats a basic security theme, described in the dos [Adding Security to a Fusion Web Application|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm] .
    Timo

  • Getting user name from sopa header

    How should get user name from soap header in my udf...?i searched in sdn,but not get exact solution...

    I din't get this with SRemoteUser
    1. i've enabled " Do Not Use SOAP Envolope"
    2.Enabled ASMA
    3.Variable Transport Binding .
    used the following code as well:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey user = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/SOAP", "SRemoteUser");
    conf.get(user);
    But not value in it.. Correct me if iam wrong..

  • How to know the all user name from system/system login

    hi all,
    i want to know the all user names from system login who are the existing user like
    regards
    srinivas

    Hello,
    Using DBA_USERS will give more details
    select * from dba_users;Regards

  • How to retrieve the all user name from system domain(including login user)?

    Hi, I am trying to get the system domain all users name. But I unable to get the all user name except domain login user name. I used the below code. What I want to do to get the all user name from system domain. Kindly any one help me.
    Properties envVars = new Properties();
    Runtime r = Runtime.getRuntime();
    String OS = System.getProperty("os.name").toLowerCase();
         if ((OS.indexOf("nt") > -1) || (OS.indexOf("windows 2000") > -1 ) || (OS.indexOf("windows xp") > -1) )
              p = r.exec( "cmd.exe /c set" );
         BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
         String line;
         while( (line = br.readLine()) != null )
              int idx = line.indexOf( '=' );
              String key = line.substring( 0, idx );
              String value = line.substring( idx+1 );
              envVars.setProperty( key, value );
         String domainDNSName = envVars.getProperty("USERDNSDOMAIN");
         String userName = envVars.getProperty("USERNAME");
         System.out.println("\n\n\n DOMAIN NAME == "+domainDNSName +" USERNAME == "+userName);
    Thanks & Regards
    Palani

    Thanks kajbj,
    I don't know, How many users in domain. I neet to get all the user names from my domain. User like A, B,C,D, E,F. I need to get this users name.
    public class Env {
         public static void main(String[] args) {
              System.out.println("USERDOMAIN: " + System.getenv("USERDOMAIN"));
              System.out.println("USERNAME: " + System.getenv("USERNAME"));
    Here , I am getting the login user name only. So i needs all user name. How to retrive or get this.
    Regards
    Palani

  • Is there any query to know the multiple users name from their ids?

    is there any query to know the multiple users name from their ids?

    Hi,
    Goto TCode SUIM  Select Users  Select Users by Address Data
    It will give you the users list
    Regards,
    Sankaran

  • Retrieve authenticated user name from environment

    Hi All,
    I'm connecting to Oracle from C++ using OCCI API. At the same time, the database authentication is based on secure Oracle Wallet feature.
    conn = env->createConnection("","",connection_string);
    Now, after I've created connection can I retrieve user name from the environment or connection object without querying database?
    Thank you.

    Hi Patrick,
    I'm just trying your code example in Eclipse but it gives me plenty of errors so I guess I'm not importing the right libraries or so.
    My goal was to write just a simple response.write of the userID stored in the cookie...
    The first error appears in the "ticket.setCertificates(this.certificates);" line, saying that "certificates cannot be resolved"..
    Here's what I used :
    import com.sapportals.portal.prt.component.*;
    import com.sap.security.*;
    public class cookie extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
              try
              com.sap.security.core.ticket.imp.Ticket ticket = new com.sap.security.core.ticket.imp.Ticket();
              ticket.setCertificates(this.certificates);
              ticket.setTicket(base64Value);
              String vali = ticket.toString();
              ticket.verify();
              if (ticket.isValid())
              info = new SAPTicketInfo(ticket.getUser(),ticket.getSystemID(),ticket.getSystemClient(),ticket.getExpirationDate(),ticket.getCodepage());
              response.write (info);
              else
              throw new TicketVerifierException("Ticket is invalid ");
              catch (Exception ex)
              throw new TicketVerifierException("Error in verifying ticket "+ex.getMessage(),ex);
    What am I missing ?

  • Extract Portal User Name From HTTP POST Request (WSRP SOAP)

    How can we extract the user name from the HTTP POST Request (*WSRP SOAP*) from the Portal to the Portlet Provider (Producer)?
    We are load balancing between the Portal (10.1.14.2) and the providers (OC4J 10.1.3.3) and would like to extract the user name within the load balancer so we can create session affinity based on it.
    BTW, we already tried using TCP Flow but were unable to see the user name.

    From the documentation, it seems that you need to use
    HttpURLConnection.setRequestMethod("POST"); // "GET" is the defaultalthough I have seen examples on the web without it.
    Try!
    Edit: Also the single quotes around userid and password may be a problem.
    Use the previous poster suggestion, but do not include the single quotes.
    Edited by: baftos on Aug 6, 2008 4:27 PM

  • User Name limitations in SQL Developer

    I am using SQL Developer from past 1 year. I am facing some issues with some of my connections which are with Numaric User Names ( Ex. User Name : 12312). In older versions it was giving error ' Invalid User name / Passoword' And in Version3 its giving *' Un Supported Verifier Type , Vendor Code: 17451'*.
    Am able to connect with same user from TOAD and Command Prompt. And with alpha numaric name i able to connect from SQL Developer also.
    Is it a limitation in SQL Developer to have user as alphanumaric only ( Starting with Charectar) ? Can somebody help me if i need to change any setting to use *'Numaric User name'*
    Thanks,
    Ram
    [email protected]

    Thanks Jim for the reply. i tried using double quotes but still the same issue. And i am able to connect from commadprompt, SQL + and from Toad. Only issue with SQL developer.

  • Pass user name from MII to SAP R/3 via JRA

    When calling in MII a BAPI that executes a goods movement in SAP R/3 via a JRA connection, the user name of the JRA connection is passed to SAP R/3 and not the user name of the person who executed the action in MII. This means that the documented goods movements in SAP R/3, that were created with the JRA connection, are all posted with the same user name. We would like to register the user name of the person who is logged into MII, because we want to know which person executed the goods movements. How can we achieve this?

    Thank you guys, enabling the autobind was a good tip.
    We don't use JRA anymore, instead we use JCO to pass the user name. This is how we did it:
    Prerequisites:
    u2022 Login name in ABAP must be the same as in Netweaver (Java) - when creating users in Netweaver, copy them from ABAP. An other option might be to map the users in Netweaver with the users of ABAP, in case users are different.
    u2022 SSO certificates have to be exchanged between the two systems, SAP R/3 and Netweaver CE.
    u2022 Profile parameters in SAP R/3 system should be correct
    Confirguration in SAP MII:
    u2022 In the JCO action block (for RFC or BAPI call) in the link editor, set SAPUserName property to u201C$MYSAPSSO2$u201D
    u2022 Define a transaction property MYSAPSSO2 and in the link editor from the JCO action block, link it to SAPSSO2Ticket property
    u2022 In MII Menu - Dataservers - XacuteConnector activate property u201CAutobindu201D
    u2022 In MII Menu - System Connection Editor - JCO (used JCO connection) - activate u201CSSOu201D

Maybe you are looking for