HELP!!! wwctx_api.get_user

I created a PL/SQL Server Page just to show the login information from a login portlet.
The code follows:
<%@ page language="PL/SQL" %>
<%@ plsql procedure="logininfo" %>
<HTML>
<HEAD><TITLE>This is a PSP Page!</TITLE></HEAD>
<BODY>
<%
declare
myname varchar2(50) := portal30.wwctx_api.get_user;
begin
htp.print(myname);
end;
%>
</BODY>
</HTML>
My Login portlet on success "P_request_url" calls for the above procedure.
My problem was no matter what user I logged on with, it always dispays "PUBLIC" as the login user. What I need is to get oracle portal user who is curently using the session. WHY? Please Help!
Thanks!

there is a diffence between portal.wwctx_api.get_user and portal_sso.wwctx_api.get_user. Check and make sure you are using the api from the right context. You're probably getting the sso user and not the portal user.

Similar Messages

  • Help: Portal calendar error when using wwctx_api.get_user

    Hi,
    I am trying to create a calendar based on some table data and results should be specific to portal user logged in. So I have created following query but it does not filter the data based on the user logged in. I have checked and there are no issues on data side.
    select
    a.EVENT_START_DT the_date,
    a.EVENT_NAME the_name,
    ( ) the_name_link,
    null the_date_link,
    null the_target,
    null the_intermedia
    from TBL_EVENTS a
    where a.Event_Status = 0
    and a.event_personal = 1
    and a.event_recorded_by = (select entryid FROM ods.CT_UID where upper(ATTRVALUE) = upper(wwctx_api.get_user))
    order by a.event_id desc
    Failing above I also tried other way using bind variable and then passing the page paramater (selecting system variables USER_NAME) to the bind variable
    Select a.EVENT_START_DT the_date,
    a.EVENT_NAME the_name,
    ( ) the_name_link,
    null the_date_link,
    null the_target,
    null the_intermedia
    from TBL_EVENTS a
    where a.Event_Status = 0
    and a.event_personal = 1
    and a.event_recorded_by = (select entryid FROM ods.CT_UID where upper(ATTRVALUE) = upper(:username))
    order by a.event_id desc
    However it still dont work.
    Can anyone please give me any suggestion or way to resolve this.
    Any help much appriciated.
    Thanks
    Ganesh

    Hi,
    I am storing OID user id but I am comparing as follows
    select
    a.EVENT_START_DT the_date,
    a.EVENT_NAME the_name,
    ('' ) the_name_link,
    null the_date_link,
    null the_target,
    null the_intermedia
    from TBL_EVENTS a
    where a.Event_Status = 0
    and a.event_personal = 1
    and a.event_recorded_by = (select entryid FROM ods.CT_UID where upper(ATTRVALUE) = upper(portal.wwctx_api.get_user)
    order by a.event_id desc
    but this comes with following error
    Unable to describe SQL statement. Please correct it (WWV-13010)
    Took exception (WWV-13005)
    ORA-01001: invalid cursor (WWV-11230)
    ORA-00921: unexpected end of SQL command (WWV-11230)
    Failed to parse as CCMPORTAL - select a.EVENT_START_DT the_date, a.EVENT_NAME the_name, ('http://portal.ccm.ac.uk/portal/page/portal/TMC/STAFFPORTAL/COLLEGE_SERVICES/COLLEGE_CALENDAR/Event%20Manager/Tab_Update?meventid=##A.EVENT_NAME##' ) the_name_link, null the_date_link, null the_target, null the_intermedia from TBL_EVENTS a where a.Event_Status = 0 and a.event_personal = 1 and a.event_recorded_by = (select entryid FROM ods.CT_UID where upper(ATTRVALUE) = upper(portal.wwctx_api.get_user) order by a.event_id desc
    I then tried creating bind variable as follows
    select
    a.EVENT_START_DT the_date,
    a.EVENT_NAME the_name,
    ('' ) the_name_link,
    null the_date_link,
    null the_target,
    null the_intermedia
    from TBL_EVENTS a
    where a.Event_Status = 0
    and a.event_personal = 1
    and a.event_recorded_by = (select entryid FROM ods.CT_UID where upper(ATTRVALUE) = upper(:musername)
    order by a.event_id desc
    and then passing system variable USER_NAME to musername in page parameter settings to the portlet.
    Please advise help
    Thanks
    Ganesh

  • How do you use PORTAL .WWCTX_API.GET_USER

    Hi. I'm a newbie at Portal and Oracle and am having a problem extracting the userID for the logged user. I have
    a form that needs to be populated with the login ID for that session. What exactly do I need so that the field will
    auto-populate with the user's ID. Do I enter the api in the "Default Value" box of the form for that field? What do I need
    to select from the "Default Value Type" dropdown?
    Also, because I'm populating the form with data from the database (it's an update record form), I'd like to "blank" the
    comment field rather than populate it with the info from the DB record. Is that possible?
    Finally, is there any recommendations on manuals or other books to purchase that would answer these types of
    questions. I feel that this is a pretty basic task and should be in a manual somewhere.
    Thanks,
    Ron

    Hi,
    In the default value column specify <portalschema>.wwctx_api.get_user. In the default return type make it "function returns varchar".
    This should help.
    Thanks,
    Sharmila

  • Using wwctx_api.get_user in dbms_rls policy

    We have not been able to succesfully use a call to wwctx_api.get_user in the function we use as a policy for row level security. The package compiles fine. The policy adds fine. When we try to select from the table where the policy is on from portal (LOV, REPORT, DYNAMIC PAGE) we get Ora-28112.
    Help?

    The error code maps to the following message:
    ORA-28112 failed to execute policy function
    Cause: The policy function has one or more error during execution.
    Action: Check the trace file and correct the errors.
    Could you try returning a static value from the security policy and do your select and see if that works.

  • PORTAL.WWCTX_API.get_user  how can i get the group?

    I'm using Oracle AP 10g
    I know the PORTAL.WWCTX_API.get_user will give you the user id , but anyone knows which one do i need to use to come out with the group name .
    P.S : the group name contains a list of certain employees
    also where can i get a list of all the API's that i can use
    Thank you
    Nedal Seyam

    Nedal Seyam wrote:
    I'm using Oracle AP 10g
    I know the PORTAL.WWCTX_API.get_user will give you the user id , but anyone knows which one do i need to use to come out with the group name .
    P.S : the group name contains a list of certain employees
    also where can i get a list of all the API's that i can useI dont know what is Oracle AP 10g.
    However, you are probably looking for the default group name for a given user. Please see wwsec_api.get_defaultgroup.
    look into wwsec_api.get_list_members for a list of members in a group.
    The links to APIs that Opportalist presented should lead you to the descriptions of both functions.
    hope that helps!
    AMN

  • Lov populated with wwctx_api.get_user

    Hi Friends ,
    I am trying to pull the records in to LOV based on the user login .."select dist from sometable where sname ='wwctx_api.get_user' ,,,But it is not returning any records ..Any help ..thanks in advance ..
    Vi

    Hi,
    I think the single quotes is the problem. It is trying to find a record with the sname = 'wwctx_api.get_user'. It should be
    select dist from sometable where sname = wwctx_api.get_user
    Thanks,
    Sharmila

  • Wwctx_api.get_user in Dynamic Page?

    Can API calls be made from select statements within the <ORACLE></ORACLE> tags in Dynamic Pages? The following query should list courses that someone has signed up for but the query cannot be saved within the Dynamic Page:
    <ORACLE>
    select course_name
    from course
    where user_id = wwctx_api.get_user
    </ORACLE>
    Regards,
    Jay
    Jay Mason
    Director, Oracle Web Applications Development
    Effective Shareholder Solutions, Inc.

    Jay,
    Just prefix the function with "PORTAL30" (or the name of the schema where Portal is installed, if not PORTAL30).
    <ORACLE>
    select course_name
    from course
    where user_id = PORTAL30.wwctx_api.get_user
    </ORACLE>
    null

  • WWCTX_API.GET_USER

    I created a custom folder and typed following sql in that:
    SELECT WWCTX_API.GET_USER from dual
    there was no problem in creating this folder.
    When i create a worksheet in plus and while running a query, its giving following errors
    ORA-14551: cannot perform a DML operation inside a query.
    ORA-06512: at "PORTAL.WWCTX_SSO",line 2954
    ORA-06512: at "PORTAL.WWCTX_SSO",line 3483
    ORA-06512: at "PORTAL.WWCTX_SSO",line 1735
    ORA-06512: at "PORTAL.WWCTX_SSO",line 2954
    ORA-06510: at PL/SQL: unhandeled user-defined exception
    ORA-06512: at
    Actually one of my query is based on SSO user id.
    When i use this "SELECT WWCTX_API.GET_USER from dual;" on SQL prompt. Its doesn't give any error.
    I need to use this WWCTX_API.GET_USER in my query. Any idea why its giving error in discoverer plus?
    Thanks

    Questions similar to yours have been answered earlier in the forum in these threads:
    http://forums.oracle.com/forums/message.jsp?id=456180
    http://forums.oracle.com/forums/message.jsp?id=628583
    You can search the forums by entering your search criteria in the text field in the upper right corner of the OTN Discussion Forum Page.

  • PORTAL.WWCTX_API.get_user

    I'm using Oracle AP 10g
    I know the PORTAL.WWCTX_API.get_user will give you the user id , but anyone knows which one do i need to use to come out with the group name .
    P.S : the group name contains a list of certain employees
    also where can i get a list of all the API's that i can use
    Thank you
    Nedal Seyam
    Edited by: Nedal Seyam on May 14, 2009 8:26 AM

    Sory, but you're in the wrong forum ;-)

  • Lack of performance using portal30.wwctx_api.get_user to limitrecords in portlets

    Hi,
    I have a portal page using 5 reports as portlets each of them use
    "where personid = portal30.wwctx_api.get_user"
    to limit the amout of data retrieve for each user.
    I have 250 users registred in login server whose can use this page.
    The 5 portlets fall in timeout every time, except if I replace "portal30.wwctx_api.get_user" by a constant,
    which is not very useful but works.
    Any idea to avoid usage of this API.
    Thanks in advance
    Didier Dubois
    mail : [email protected]
    mobile : +33 (0)6 74 68 54 78

    Hi,
    Instead of using the api in the query, use a bind variable and then customize the report to pick up the value from the api. Here is an example
    1) Create a sql report
    select * from usertab
    where user_id = :userid
    2) Publish this report on a page
    3) Now edit the page and go to the edit defaults of the report.
    4) You will have a textbox against userid. Here you enter #<portalschema>.wwctx_api.get_user
    Please replace the portalschema with the name of your portal schema.
    Thanks,
    Sharmila

  • Wwctx_api.get_user only returns PUBLIC

    I am trying to determine the user who has logged onto Portal, but this package only returns PUBLIC. I've seen in previous postings that this is the package to use - what am I doing wrong?

    Well, I'm almost stumped. As far as I know, you are in a different context when executing a PL/SQL routine directly through the DAD. The username & password are stored with the Portal DAD (similar to old OAS functionality), so the engine doesn't know who you are. You can try using a different DAD w/o username and password stored, but then you'd have to create database schemas for all of your users. In this case, you would probably have to use an OWA package to find out who they are, because they are not logged in to Portal.
    A better solution might be to create Forms based on Stored Procedure components for all of your procedures, which would enable you to keep the users in the Portal context. You would just have to create at least one (dummy) parameter for each, because forms based on stored procedures need a parameter.
    --Kelly                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Needed help on java script and html in PL/SQL doing nothing

    Hi,
    Created a procedure which takes username and password and changes OID, database password for that user with that password.
    I created a page in oracle portal and trying to call this below script package:
    BEGIN
    user_name := portal.wwctx_api.get_user;
    HTP.p
         <!-- BEGIN CODE FRAGMENT -->
         <script language="javascript">
         <!--
         function ValidatePass()
         var passStr = document.getElementByid("p_password").value;
         var confPassStr = document.getElementByid("Confirm_Password").value;
              var pattern = /[^a-zA-Z0-9]/;
              if (passStr == null || passStr == "") {
                   alert("Password value missing");
                   return;
              if (confPassStr == null || confPassStr == "") {
                   alert("Confirm password value missing");
                   return;
              if (passStr.match(pattern) == null && confPassStr.match(pattern) == null) {
                   if (passStr == confPassStr) {
                        document.form.submit();
                   } else {
                        alert("Your entries did not match. Please try again!");
              } else {
                   alert("Invalid charcters entered");
         //-->
         </script>
         <form name="changepassword"
         action="http://<hostname>:7777/pls/sys/sys.gx_user_mgt.globally_update_password"
              method="post" AutoComplete="Off">
    <input type="hidden" name="username" value=" '
    || user_name
    || ' " id="p_username"/>
    New Password:
    <input type="password" name="p_password" id="p_password">
    <br>
    <br>
    Confirm Password:
    <input type="password" name="Confirm_Password" id="Confirm_Password">
    <br>
    <br>
    <input style="padding:2px;" type="submit" value=Login onClick="ValidatePass();">
    </form>
    END;
    This gx_user_mgt.globally_update_password is the custom procedure I should call passing username and p_password
    Thanks in advance.

    Friends I want to try something but I am totally lost on how to achieve it.Just to let u know that I have not worked in JAVASCRPT at all.And I am in great hurry to finish this work.
    What I am looking for is :
    1) a JSP page is thrown
    2) a button is clicked
    3)Moment the button is clicked I want a file to be created with an extension HTML (having all the info from the database) by using FileWriter class .After the file is created and ready ,Then I want to open this file in another browser window.
    I know that to achieve this I have to use Javascript,but I am totally lost on how to do that.
    I mean can I say in JAVASCRIPT that if this button is clicked then execute a java method which retrives data from the oracle database in the server and writes it to a HTML file and then after the writing is done,open it another window.
    Please help.

  • Help need to script(urgent)

    hai everybody...
    i ahve written a javascript for popup a new
    window...this is my script
    script
    function open()
    if(portal40.wwctx_api.get_user=='JAYANTHAN')
    window.open('http://suntechchn:7777/pls/portal40/ATCMIS.ENQUIRY_REP.show?p_arg_names=_show_header&p_arg_values=YES&p_arg_names=_max_rows&p_arg_values=25&p_arg_names=_portal_max_row s&p_arg_values=25','new_page','width=1500,height=550,scrollbars=yes');
    else
    window.open('http://suntechchn:7777/pls/portal40/ATCMIS.ENQ_REPORT.show?p_arg_names=_show_header&p_arg_values=YES&p_arg_names=_max_rows&p_arg_values=25&p_arg_names=_portal_max_rows &p_arg_values=25','new_page','width=1000,height=950,scrollbars=yes');
    open();
    but it doesn't open the new window...
    for this i have created two reports,the above links are the report links...if it satisfy the condition then the first link lead to the
    first report if not then second report
    please help need ....
    thansk in advance
    leena
    null

    This example will read and put the Authors name to the ESTK console and write the new details back to the document.
    #target bridge
    loadXMPLibrary();
    var thumb = app.document.selections[0];
    if(thumb.hasMetadata){
            var selectedFile = thumb.spec;
      var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
      var myXmp = myXmpFile.getXMP();   
      var arrItem='';
      var items = myXmp.countArrayItems(XMPConst.NS_DC, "creator");
       for(var i = 1;i <= items;i++){
    arrItem += myXmp.getArrayItem(XMPConst.NS_DC,  "creator", i);          
        $.writeln(arrItem);
    var Author = "This is my new Author";
    myXmp.deleteProperty(XMPConst.NS_DC, "creator");
    myXmp.appendArrayItem(XMPConst.NS_DC, "creator", Author, 0,XMPConst.ARRAY_IS_ORDERED);
    if (myXmpFile.canPutXMP(myXmp)) {
        myXmpFile.putXMP(myXmp);
             myXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
    unloadXMPLibrary();
    function loadXMPLib(){
    if (ExternalObject.AdobeXMPScript == undefined) {
        ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    function unloadXMPLib(){
       if( ExternalObject.AdobeXMPScript ) {
          try{
             ExternalObject.AdobeXMPScript.unload();
             ExternalObject.AdobeXMPScript = undefined;
          }catch (e){ }

  • Portal form help needed

    hi
    i am developing a portal form based on a table with 3 coloumns(comment, sender and date). the form has a taxt box in which the user is supposed to enter the comment, and a "Send" button. the event handler for the button looks liek this:
    declare name varchar2(60);
         comment_text varchar2(2000);
    begin
    ime:=wwctx_api.get_user;
    comment_text:=p_session.get_value_as_varchar2(p_block_name=>'DEFAULT',p_attribute_name=>'comment');
    insert into poraki values (comment_text, name, sysdate);
    end;
    but when i press the "send" button, this is what i get:
    Error: (WWV-00000)
    can anyone please help?

    hi
    i've amde some mistakes while typing the previous message, so here is the right one:
    i am developing a portal form based on a table with 3 coloumns(comment, sender and date). the form has a taxt box in which the user is supposed to enter the comment, and a "Send" button. the event handler for the button looks like this:
    declare name varchar2(60);
         comment_text varchar2(2000);
    begin
    name:=wwctx_api.get_user;
    sodrzina:=p_session.get_value_as_varchar2(p_block_name=>'DEFAULT',p_attribute_name=>'comment');
    insert into poraki values (comment_text, name, sysdate);
    end;
    but when i press the "send" button, this is what i get:
    Error: (WWV-00000)
    can anyone please help?

  • Master Detail Help -- very urgent

    There are two things I need to do:
    Auto query the form querying on a detail record week_ending and also on a master record.
    Means this is what query should like :
    select * from user_table a, week_ending_table b
    where
    a.id = b.user_id
    and
    a.user_id = portal30.wwctx_api.get_user
    and
    b.week_ending = '02-MAR-89';
    So when I query this is the query I would like to see but not when i click query button, I want to see it when i bring query up.
    Please help!

    Hi,
    I have written what I needed to in reply to the other question, but just thought if something.
    I want week ending hardcoded like 99-MAR- 02. In Method 1 , where do I put that? You have used variable l_week_ending but never defined what it is. One thing is I am not really querying on detail, I just want week ending to always be a certain date...
    Thanks,
    Amrita

Maybe you are looking for