How to retrieve the current User using PL_/SQL code?

Hi,
How can find the current logged user within a Dynamic Page using PL/SQL code?
Thanks.

Hi,
There is a function wwctx_api.get_user which returns the logged in user. You can use this in your plsql code.
Thanks,
Sharmila

Similar Messages

  • Q: How to retrieve the current URL with PL/SQL

    I've got a pair of dynamic page portlets on a page. The first is simply an input text box and a submit button, the second is an inventory 'report' based on what is entered in the text box. When a value is entered and the button pressed, there is javascript behind the button that takes the current URL, adds '&ITEM=XXXXXXXX' (removing it first if this is not the first invocation of the page), and redirects to the new page.
    The second portlet uses the &ITEM parm to list a bill of materials for the item. If one of the items possesses a sub-assembly, I want to display the item# in an <a href= manner to make it so the user can simply click on the link to see the BOM of the subassembly.
    To do this, I believe I need to capture the current url and modify it as required to pass the new &ITEM value. I'm having a lot of trouble trying to figure out how to get the current page url. Any help would be greatly appreciated!
    Geoff

    Hello
    I have a similar problem I have developed a pl/sql portlet and put it into a page, this portlets display a dynamic page. This dynamic page have a search functionality, what I am trying to do is that when I click the search button on the dynamic page it recall the whole page and pass the paremeter that the user wrote on the search box, then the portlet that contains the dynamic page recieve the parameter and recall the dynamic page with the parameter that was received. The problem that I have is that the portlet receive the parameter but when I pass the parameter to the dynamic page it doesn't get it. This is the way the I am calling the dynamic page inside my portlet into the show procedure:
    EXECUTE IMMEDIATE
    'begin
    APP_NAME.PG_DYN_DIR_ALFABETICO.show (
    p_arg_names => PORTAL30.wwv_standard_util.string_to_table2(''url_page'',''search_param''),
    p_arg_values => PORTAL30.wwv_standard_util.string_to_table2(:1,:2));
    end;'
    using url_pg,p_text1;
    The dynamic page receive the first parameter(url_page) but not the second one(p_text1), I have checked that the p_text1 has a value on my portlet before I send it to the dynamic page so I really don't understand why my dynamic page doesn't work.
    Please HELP ME. I am desperate
    Ana Lasprilla

  • How to switch user from the current user using shell script code

    Hi Experts,
    I have an requirement to login into a particular user from the shell script concurrent program. I do have credentials for that particular user. I want to login and run few commands from that particular user. Please let me know if there are any methods to login as a particular user using the username, password from shell script program.
    Thanks a lot.

    Thanks for your reply. However we cannot use su command from a shell script program. How to enter password from shell script program?http://tinyurl.com/3t7cwjh
    Thanks,
    Hussein

  • How to get the current user logon to portal?

    Hi Gurus,
    How to get the current user who logged into portal.
    I have a webdynpro requirement where in which I have to get the current user id who loggedinto portal which will be the input parameter of the BAPI(adaptive RFC model) which will return me employee number of the particular user.
    Can anyone send me the code to retrive the user id through webdynpro application..........
    Pts will be rewarded for useful inputs......
    Thanks in Advance,
    Dharani

    Hi Dharani,
    Using UMEfactory u can do that...
    1. create one input field,
    2. create one attribute called Uid
    3. assign Uid attribute to the input field
    4. type the following code in Doinit() method
                String uid = wdContext.currentContextElement().getUid();
         try {
         IUser user = UMFactory.getUserFactory().
         getUserByLogonID(uid);
         String userName = user.getDisplayName();
         } catch (UMException ex) {
          e.toString(); 
    5. after that go to Portal create one iview assign to particular user. then u get into the user details...
    thats it
    Regards,
    P.Manivannan

  • How to get the Current User on the UI page?

    All,
    Could you please let me know how to get the Current user on the UI input page , i need to display the current user ID when some one clicks the submit button, i want o get the current user to display in the javascript alert box.
    Edited by: 951930 on Oct 24, 2012 12:21 PM

    lucky,
    my schema has already defined for
    <user mapField="USER_ID" default="%CurrentUser"/>
    and in my UI page
    <td oraLabel="user"></td><td oraField="user" id="userId" ></td>
    and my javascript
    function showUserId () {                        
    var curUser = document.getElementById('userId').value;
    alert(curUser);
    and i have called this function on my submit button, but i am not able to get Current Logged User ID value to show in the alert nor able to show the current logged user on the UI page.
    my requirement is on custom UI page i need to show Current Logged User in one corner of the page and also need to show the same user in alert when he submits the button.
    Appreciate for the help.
    Edited by: 951930 on Oct 25, 2012 8:42 AM
    Edited by: 951930 on Oct 25, 2012 9:06 AM

  • How to add the current user to a people picker using javascript coding in document library

    Hi Everyone,
    This is my scenario,
    I have a document library,for this if any user uploads a document,there we have three content types(Ex:content1,content2,content3)
    if the uploaded user is from content 1(here we have four columns name,assigned to ,status,published to) after uploading the document the document has to be updated.so when the document is updated by the user then automatically the published filed people
    picker has to be filled up with the current user name this is done by using java script object model programming.
    i am stuck with this can anyone help me..............
    thanks in advance
    Ramu

    Hi,
    I understand that you want to set a people picker field value automatically to current user. You can use these ECMA scripts on your EditForm.aspx page. Edit the page in SharePoint designer and add the code before a </asp:Content> tag.
     <script type="text/javascript">
    var context = null;
     var web = null;
     var currentUser = null;
    ExecuteOrDelayUntilScriptLoaded(GetUserLoginName, "sp.js");
    function GetUserLoginName() {
    context = new SP.ClientContext.get_current();
     web = context.get_web();
     this._currentUser = web.get_currentUser();
     context.load(this._currentUser);
     context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),
    Function.createDelegate(this, this.onFailureMethod));
     function onSuccessMethod(sender, args) {
     var today = new Date();
     alert('Name:' + this._currentUser.get_title() + '\n Login:' + this._currentUser.get_loginName()); document.getElementById('ctl00_m_g_9b4b3950_80d8_4e6e_b2fa_241b727d83d4_ctl00_ctl02_ctl00_ctl02_ctl00_ctl00_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_UserField_upLevelDiv').innerHTML=this._currentUser.get_title();//you
    need to change the ID here to you people picker field ID. You can get the id for this field with the help of IE developer tool.
     function onFaiureMethod(sender, args) {
     alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
     </script>
    For more information, please refer to this site:
    Get current user’s LoginName Ecmascript Sharepoint 2010:
    http://www.learningsharepoint.com/2011/05/18/get-current-users-loginname-ecmascript-sharepoint-2010/
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • How to get the current user name of the host who is occupying a specific VM?

    I'm developing a winform app with c# code to manage Hyper-V. I need to remind someone if he/she would take a VM which has already been occupied by others.
    Is there any powershell cmd or WMI interface to get the current user of a specific VM?
    Thanks!

    Hiya,
    from cmd there are quser(Query user) and qwinsta(Query Session)
    which should give you that. Don't know how you can incoorperate that in C#, but that should give you something to work with :)
    https://technet.microsoft.com/en-us/library/cc785434.aspx
    https://technet.microsoft.com/en-us/library/cc788125.aspx

  • How to reference the current user ID in an URL  iView

    Hi
      I have created an iview based on URL iview.
      I need to pass the logged on portal user id as parameter to a url.We are using EP6 SP2.
    Can any body help me in this regard.
    Regards
    Sayantan

    Hi SAYANTAN,
    You can create a dynpage that takes the current user id, use it to construct the url,
    and redirects to that url in doProcessBeforeOutput():
    public void doProcessBeforeOutput() throws PageException {
       Form myForm = this.getForm();
       IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();     
       IUser currUser = (IUser)request.getUser().getUser();
       String userid = currUser.getId();
       String url = "http://myUrl.com?userid="+userid;
       myForm.addRawText("<script>");
       myForm.addRawText("open(""+url+"","_self");");
       myForm.addRawText("</script>");      
    Hope that helps,
    Yoav.

  • How to find the current User Name and stored in which table

    In which table the current user name (Login) is stored?

    Hi Mohanapriya
    The query provided by Gordon can not run on query generator as the $USER is a runtime variable.
    You need to save it to a query then use it in a FMS(Formatted Search.)
    Just open a form(ex:sales order ), click the field in which you want to show the user name,
    then press ****+F2 or Tools->Search Function->Define,
    Search by Saved query,then assign the save query to the field.
    After that ,you can run the FMS(shift+F2) to get the current user info.
    Regards,
    Syn Qin
    SAP Business One Forums Team

  • Retrieve the Current Users User Object

    Can anyone point me at a code snippet that will grab the current users "User" object from AD?
    I've found endless examples of querying LDAP using a recordset, but not using the system object model. I found it some months back but can't find it now!
    Thanks
    Gordon

    Hi,
    According to your description, you issue is more related to VBA code, and this is the forum to discuss questions and feedback for Microsoft Excel, I recommend you post the question toMSDN forum for Visual Basic for Applications
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=isvvba
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to retrieve the content type used in a document library (C# - Client Model).

    Hello,
    I need to know if it's possible to retrieve the content type used in a document library, so I can know the columns active and used in this document library. I am using the Client Model in C#.
    Thanks

    First, retrieve your document library as a List object. Then, use the
    List.ContentTypes property to iterate through all the content types assigned to the list.
    Blog:
    blog.beckybertram.com |
    RSS | @beckybertram |
    SharePoint 2010: Six-in-One

  • How to find the current users logged in.

    Hi,
    I have a problem in finding the current users logged into the database and the operations they are doing.
    If u know pls help me........
    Thanks.
    K.Vijay Choudary Reddy.

    hi vijay,
    this is the OracleAS Portal Content Management forum. Please post your database related question in the Database Forum:
    General Database Discussions
    thanks,
    christian

  • How to get the current User Id

    Hi,
    is there any system variable containing the current "user code"
    because, based on current user code, i would like to get the branch from OUSR, so that, one query can display only those records pertaining to that branch.
    Thanks & Regards,
    Kr

    Hi
    You can create a formatted search to get and the following query:
    SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
    Paulo Calado
    SAP Business One Forums Team

  • How to get the SSO user from PL/SQL with Windows native authen

    I connect to a 10g daabase using SSO through Windows Native Authentication wher the OID user mapps to a single Database user.
    I need to get the SSO user from pl/sql
    My fornt end is Portal & Forms

    Hmm, I see.
    Well your problem boils down to being in the database and needing to have access to web environment variables. The SSO sets specific variables in the environment but your stored procedure is not privy to them.
    Now having said that, note that the mod_plsql Web Toolkit has a utility for accessing cgi variables. For instance,
    owa_util.get_cgi_env('Osso-User-Dn')
    If your web application cannot capture the SSO info and pass it to the stored proc in a parameter, OWA may be the only way.
    Check out the Single Sign-On Developers Guide, specifically the part about developing statically protected PLSQL applications.
    Hope this helps.
    regards,
    tt

  • How to create dynamic HTML page using PL/SQL code in APEX.

    hello,
    I am woking on one APEX application in which i want to create one dynamic HTML page on button press using PL/SQL code.
    Thanks

    It is possible to create HTML page with dynamic content. One way would be creating hidden field (e.g. P1_HTML on page 1) with dynamic HTML and on button click you redirect to page 2 and pass P1_HTML item value to item P2_HTML on page 2. On page you must have PL/SQL region. You can then render your dynamic HTML with code:
    htp.p(:P2_HTML);
    Don use APEX URL for passing HTML value. Problem and solution is described here: http://blog.trent-schafer.com/2011/04/03/dont-pass-string-parameters-in-the-url-in-apex-its-a-bad-idea/
    Edited by: MiroMas on 3.2.2012 3:20

Maybe you are looking for