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.

Similar Messages

  • 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

  • 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

  • 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.

  • 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.

  • 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

  • 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

  • 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

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Wwctx_api !

    Hi Dmitry,
    Thanks for the reply .
    If i hardcode it and run the report then it gives the results within no time .
    The problem is when i directly compare it using the api in the SQL, it takes a lot and lots of time only to give the mesg ' page expired / timed out '.
    I did a work-around by calling the api in the before page display plsql and then pass it as a parameter to the report .This works fine .
    ( However this gives a problem when i have a parameter report , the user parameter gets un-necesarily displayed in the parameter form .)
    Regards,
    Vijaya

    What schema is your procedure running in?
    Is it called from the web?
    You need to do the following...
    - the request needs to come from the web, so that the session context is set, with an appropriate session cookie.
    - if your code is not in the portal schema, then it must be in another schema on which you have run the script provsyns.sql
    in order to gain access to the appropriate APIs (such as wwctx_api).
    - if the user has logged into the portal, then you need to run the session context check against the portal schema, e.g.,
    portal30.wwctx_api.get_user -- not in orasso.
    Hope that helps.

  • HOW TO SET UP PARTNER APPLICATION TO USE SSO OUTSIDE OF PORTAL

    If anyone knows how Portal switches context to run as the db user mapped to the lightweight schema and how it knows the db schema password please let me know.
    Should you have any queries please do not hesitate to contact me on 07775 896738.
    From document Oracle Portal Security Overview on PortalStudio.oracle.com:
    In Single Sign On mode (EnableSSO=Yes in the DAD), mod_plsql determines the name of the light-weight user and mapped database schema by calling
    WPG_SESSION_PRIVATE.GET_LW_USER and WPG_SESSION_PRIVATE.GET_DB_USER respectively.
    ** These calls are done using the Portal Schema (PORTAL30) and Portal schema password **
    mod_plsql then executes the procedure in the requested URL by using the N-Tier Authentication feature to connect to the database as the user returned from
    WPG_SESSION_PRIVATE.GET_DB_USER. ..... Note that N-Tier Authentication requires all schemas to be used for Portal user mappings to be granted 'connect
    through' privleges to the Portal schema (PORTAL30).
    The WWCTX packages are also used.
    So this is how it works with standard Portal
    - the document states that the WPG_SESSION_PRIVATE package is only accessible to the Portal schema
    - but I checked and it is also available to PORTAL30_SSO
    SQL> desc WPG_SESSION_PRIVATE
    PROCEDURE CREATE_SESSION
    Argument Name Type In/Out Default?
    P_COOKIE_NAME VARCHAR2 IN
    FUNCTION GET_DB_USER RETURNS VARCHAR2
    FUNCTION GET_LW_USER RETURNS VARCHAR2
    PROCEDURE GET_SESSION_INFO
    Argument Name Type In/Out Default?
    NUM_PARAMS NUMBER OUT
    PARAM_NAMES TABLE OF VARCHAR2(32000) OUT
    PARAM_VALUES TABLE OF VARCHAR2(32000) OUT
    PROCEDURE RESET_SESSION
    Argument Name Type In/Out Default?
    P_COOKIE_NAME VARCHAR2 IN
    In my case only the Login Server (PORTAL30_SSO) is going to be used/installed
    - the SAMPLE_SSO_PAPP application will only work if the DAD used to access is it set to use Basic authentication, i.e. the actual integration with the Login Server
    is done in the sample application code calls, stored in the database
    - when a DAD has enableSSO=yes it automatically accesses Portal (PORTAL30) packages to implement N-Tier authentication
    I'm currently testing:
    1. Configuring the SAMPLE_SSO_PAPP sample as documented with a DAD with Basic authentication
    2. Amending the ssoapp procedure to set context to another (db) user on successful authentication:
    wwctx_api.set_context (
    p_user_name => 'SCOTT',
    p_password => 'TIGER' );
    3. If this works then set_context with get_lw_user instead
    I have now amended the ssoapp procedure as follows to print out
    1. The userid entered when the login box is presented
    2. The Database user which the Portal Lightweight user is mapped to
    3. The Lightweight user Portal has used for authentication
    Amendments to papp.pkb:
    (ssoapp procedure, declare db_user_info and lw_user_info as VARCHAR2 in declare section)
    htp.p('Congratulations! It is working!<br>');
    db_user_info := wwctx_api.get_db_user;
    lw_user_info := wwctx_api.get_user;
    htp.p('User Information:' || l_user_info || '<br>');
    htp.p('DB User Information:' || db_user_info || '<br>');
    htp.p('LW User Information:' || lw_user_info || '<br>');
    The following shows the interesting results from my testing:
    - if the user owning the sample_sso_papp package is PORTAL30_SSO then the call to wwctx_api.get_db_user succeeds
    - if the user owning the sample_sso_papp package is a non-portal schema e.g. SSOAPP below the call to wwctx_api.get_db_user generates a User Defined exception
    Steps to test:
    Created new schema SSOAPP on the database
    - edited it in Portal and checked the use this schema for Portal users checkbox
    - created new Lightweight user SSO_LW in Portal, mapped it to SSOAPP schema
    - created new Lightweight user SSO_SCOTT in Portal, mapped to SCOTT schema
    - loadjava -user ssoapp/ssoapp@portal30 SSOHash.class
    - sqlplus portal30/portal30@portal30
    @provsyns ssoapp
    - sqlplus ssoapp/ssoapp@portal30
    @loadsdk.sql
    @loadpapp.sql
    Created DAD with basic authentication SAMPLE_SSO_PAPP
    - username: ssoapp
    - default home page: sample_sso_papp.ssoapp
    Registered the Sample SSO Partner Application with the Login Server and ran regapp.sql
    Commented out the calls to get_db_user in papp.pkb to avoid exception
    - called http://<server>/pls/sample_sso_papp
    - logged on as SSO_LW/sso_lw
    - got output:
    Congratulations! It is working!
    User Information: SSO_LW
    LW User Information: PUBLIC
    So the Portal lightweight user is not returned as SSO_LW
    if anyone knows why the Lightweight User in my test is returned as PUBLIC not SSO_LW
    Best Regards
    MIchael

    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

  • Partner application access to portal login info

    How can an SSO partner application (Java) tell whether or not a user has logged in to Portal?
    I need to log activity in a public application servlet, so I'd like to log the user as PUBLIC if not logged in or as their actual userid.
    I don't seem to have access to this info until the user has visited a secure part of the app.
    Any pointers would be appreciated.
    Thanks
    Rob

    DIY answer ...
    The cludge I used to get round this was ...
    Make a PL/SQL item which displays a Login or Logout link as appropriate, based on the current userid from portal.wwctx_api.get_user.
    The login link goes to a secure portal page called FORCE_LOGIN, passing a URL parameter called nextPageURL which contains the URL of the next page to show after the login is complete. You can use portal.wwpro_api_parameters.get_value( '_pageid', 'a'); to help build the current page URL if you want to retun to the current page.
    The FOIRCE_LOGIN page contains a PL/SQL item which builds an IFRAME whos src is a URL to my app servlet ForceLoginServlet, passing on the nextPageURL parameter. Use portal.wwpro_api_parameters.get_value( 'nextPageURL', 'a'); to help with that.
    The ForceLoginServlet is a secure servlet (set up in web.xml) so that forces a silent authentication to my app. All the servlet does is display HTML to redirect back to the URL in nextPageURL.
    Horrible! But it does the job.
    Anyone who know a better way of doing this, please tell me.
    Rob

  • Unable to get Portal User in a Remote DB

    Hello,
    We are developing an application with Portal on Instance A and the application tables on Instance B. We have DB triggers on the application tables in B and would like to capture the Portal USER using wwctx_api.get_user. Have created a DB link and PUBLIC SYNONYM in B to access the package in A. However, when we call the function in B, we get the following error -
    ORA-00164: autonomous transaction disallowed within distributed transaction.
    Has anyone tried something similar?
    Thanks.

    Hi,
    If you submit your form to a procedure in the portal instance you can get the portal user inside of this procedure.
    you can then send this value to the table in the other instance.
    Regards
    Michael

Maybe you are looking for