AUTHID CURRENT_USER

Hi,
What is the difference between two..
CREATE OR REPLACE FUNCTION func_temp
RETURN NUMBER
AUTHID CURRENT_USER
AS
BEGIN
RETURN 1;
END;
and
CREATE OR REPLACE FUNCTION func_temp
RETURN NUMBER
AS
BEGIN
RETURN 1;
END;
Please tell me what its the use of AUTHID CURRENT_USER here.
Thanks,
Vinod

By default, stored procedures and SQL methods execute with the privileges of their owner, not their current user. Such definer's rights subprograms are bound to the schema in which they reside, allowing you to refer to objects in the same schema without qualifying their names. For example, if schemas HR and OE both have a table called departments, a procedure owned by HR can refer to departments rather than HR.departments. If user OE calls HR's procedure, the procedure still accesses the departments table owned by HR.
If you compile the same procedure in both schemas, you can define the schema name as a variable in SQL*Plus and refer to the table like &schema..departments. The code is portable, but if you change it, you must recompile it in each schema.
A more maintainable way is to use the AUTHID clause, which makes stored procedures and SQL methods execute with the privileges and schema context of the calling user. You can create one instance of the procedure, and many users can call it to access their own data.

Similar Messages

  • Using AUTHID = CURRENT_USER and Apex

    I'm new to Apex and am just assessing if we can make use of it, mainly for reporting functionality in our existing web based application.
    We have a schema that holds all of our procedures, packages, functions etc and they all have AUTHID = CURRENT_USER so each user can have their own set of tables in their own schema.
    I want to be able to create reports in Apex that will then report on the users table in their own schema but I can't quite work out how Apex actually works. Can I tell something in Apex to use AUTHID = CURRENT_USER?
    We used Webdb many years ago and that created the runtime package for all the forms and reports but I can't see anything that Apex creates so I assume it stores all the code in a table somewhere?
    Thanks
    Robert

    Hi Scott,
    does that mean, there is no way to make these packages work? Not even with additional direct grants to apex_public_user? I am aware of the implications but we have a significant amount of code using packages with authid current user.
    Our situation:
    We have four oracle schemas involved in a multi tenant application.
    GLB : Global objects
    BEE: tenant 1
    SIX: tenant 2
    IAM: tenant 3
    Then we have the user APEX_SCM. There we store the tables and objects for the APEX application. This is the parsing schema for the application.
    During page rendering we try change the CURRENT_SCHEMA to one of the tenants:
    declare
      l_sql varchar2(2000);
    begin
      if :P42_BRAND is null then
        :P42_BRAND := 'SIX';
      end if;
      l_sql := 'alter session set current_schema=' ||:P42_BRAND;
      apex_application.debug(l_sql);
      execute immediate l_sql;
    end;Then we call a stored function returning the report result:
    select *
    from table(six.inv_val_report_pack.fn_rpt_ar_nlf(to_number(:P42_BL_INV_CHECK_ID))) t,
      apex_scm.st_sor_v s, six.ls, ar
    where s.st_sor_id(+) = t.st_sor_id
    and ls.ls_id(+) = t.ls_id
    and ar.ar_id(+) = t.ar_idThe function is in a package with invoker rights:
    create or replace package inv_val_report_pack
    authid current_user
    is
    ...Now my questions:
    1) Is there a way to make this work (using invoker rights packages)?
    2) We cannot get the name resolution to work. Does execute immediate 'alter session set current schema=SIX' work at all? It seems to be ignored.
    I ran a test in the sql workshop as the parsing schema APEX_SCM.
    declare
    l number;
    begin
      execute immediate 'alter session set current_schema=SIX';
      select null into l from ls
      where rownum=1 ;
    end;
    /It only worked after I created a local synoynm for ls in the schema APEX_SCM. Weird, it seems like 'alter session set current schema=SIX' is just plain ignored.
    Any help would be greatly appreciated, by anyone ;).
    Thanks,
    ~Dietmar.

  • Equivalent for AUTHID CURRENT_USER in view

    Hi, I'm facing a problem with a view which belongs to user a and I would like to select tables from user b.
    Exemple :
    user a - table MYTAB
    user b - table MYTAB
    done by user a : "create or replace view MYVIEW as select * from MYTAB"
    grants and synonyms done for both users
    if I execute from user b : "select * from MYVIEW", I get the data from a.MYTAB, not b.MYTAB
    What can I do to force MYVIEW to select from current user's table ? (juste like the AUTHID CURRENT_USER for procs)
    Do I have to create the view in all schemas ?
    Thx in advance

    I wanted exactly the same thing. It's not ideal, but here is what I did. I did it like this so that I can hide away any complexity from other users, and just give them a view that they need not worry about the internal nuts and bolts of.
    It's a bit fiddly, but it goes like this.
    1. In schema A, create an AUTHID CURRENT_USER package. Let's call it pkg_A.
    2. Add a PIPELINED table function to pkg_A, let's call it pipe_rows. For this thread/example, into this function you put the query in question.
    3. Or, you might put the query in a global, public pkg cursor. That way, you can declare a TABLE of that %ROWTYPE. A pipelined function can then return this table-type.
    4. In schema B, create a view, let's call it pkg_A_pipe_rows_vw_in_B. Yes, this means creating a view in Schema-B, which we were hoping to avoid, but this is really simple, and now all the 'nuts and bolts' are common, generic, and hidden away in Schema-A. This view is as simple as:-
    CREATE OR REPLACE VIEW pkg_A_pipe_rows_vw_in_B AS
    SELECT * FROM TABLE(pkg_A.pipe_rows);Note, this view MUST be in Schema-B, as previously pointed out, a view <b>always</b> resolves to objects in the schema into which the view is compiled. This is very confusing, given that the package being called is AUTHID CURRENT_USER.
    This code demo's points 1-3.
    CREATE OR REPLACE PACKAGE pkg_A
    AUTHID CURRENT_USER AS
        CURSOR G_PIPE_CSR IS SELECT * FROM DUAL; -- not good eg, need tab in BOTH schemas with diff data
        TYPE G_PIPE_TABLE IS TABLE OF G_PIPE_CSR %ROWTYPE;
        FUNCTION pipe_rows
        ( param1 IN VARCHAR2 := 'DEFAULT' ) -- can pass params but not from the view in (4) so must default
        RETURN G_PIPE_TABLE
        PIPELINED;
    END;
    CREATE OR REPLACE PACKAGE BODY pkg_A AS
        FUNCTION pipe_rows
        ( param1 IN VARCHAR2 := 'DEFAULT' ) -- can pass params but not from the view in (4) so must default
        RETURN G_PIPE_TABLE
        PIPELINED IS
            l_pipe_row G_PIPE_CSR %ROWTYPE;
        BEGIN
            OPEN G_PIPE_CSR;
            LOOP
                FETCH G_PIPE_CSR INTO l_pipe_row;
                EXIT WHEN G_PIPE_CSR %NOTFOUND;
                PIPE ROW(l_pipe_row);
            END LOOP;
            RETURN;
        END;
    END;
    /As you can't pass params from the view in schema-B, what you can do is provide further 'set' procedures in the package which assign values to global vars, then use the global vars (or public 'get' functions that return the same), when you issue the query. This, again, isn't brilliant. You could set local vars based on the user-id, time of day, etc, etc, and use these in the query.
    Btw, I disagree with William's point:->
    For this reason invoker's rights procedures are usually best for utilities that don't do DML.>
    Providing these utilities are well advertised as resolving against the CURRENT_USER's schema, this is how you can provide generic access mechanisms for like-data in disparate schemas. For example, we are client driven, client A's data is separate from client B's data, but we provide the same service to both parties. (Although, William did say "usually"!)
    Regards,
    Cloink.

  • Defining AUTHID CURRENT_USER dynamically

    HI,
    I would like to set up all my Oracle 10G procedures and functions to be defined as AUTHID CURRENT_USER dynamically, such as
    ALTER PROCEDURE MYPROC1 AUTHID CURRENT_USER.
    Is there a way to do this dynamically or do I have to owerwrite every sources to do this ?
    Thx in advance.

    Hi,
    I need to do this in a specific migration case where I do have several schemas having the same tables.
    I'm really surprised I can't do this dynamically, perharps by changing the sys table named procedure$

  • Authid current_user using

    Hello,
    I have question regarding authid current_user.
    What is the disadvantages of using AUTHID CURRENT_USER for developer?
    What is the advantages of using AUTHID CURRENT_USER for dba?
    Thanks a lot,

    Hi Scott,
    does that mean, there is no way to make these packages work? Not even with additional direct grants to apex_public_user? I am aware of the implications but we have a significant amount of code using packages with authid current user.
    Our situation:
    We have four oracle schemas involved in a multi tenant application.
    GLB : Global objects
    BEE: tenant 1
    SIX: tenant 2
    IAM: tenant 3
    Then we have the user APEX_SCM. There we store the tables and objects for the APEX application. This is the parsing schema for the application.
    During page rendering we try change the CURRENT_SCHEMA to one of the tenants:
    declare
      l_sql varchar2(2000);
    begin
      if :P42_BRAND is null then
        :P42_BRAND := 'SIX';
      end if;
      l_sql := 'alter session set current_schema=' ||:P42_BRAND;
      apex_application.debug(l_sql);
      execute immediate l_sql;
    end;Then we call a stored function returning the report result:
    select *
    from table(six.inv_val_report_pack.fn_rpt_ar_nlf(to_number(:P42_BL_INV_CHECK_ID))) t,
      apex_scm.st_sor_v s, six.ls, ar
    where s.st_sor_id(+) = t.st_sor_id
    and ls.ls_id(+) = t.ls_id
    and ar.ar_id(+) = t.ar_idThe function is in a package with invoker rights:
    create or replace package inv_val_report_pack
    authid current_user
    is
    ...Now my questions:
    1) Is there a way to make this work (using invoker rights packages)?
    2) We cannot get the name resolution to work. Does execute immediate 'alter session set current schema=SIX' work at all? It seems to be ignored.
    I ran a test in the sql workshop as the parsing schema APEX_SCM.
    declare
    l number;
    begin
      execute immediate 'alter session set current_schema=SIX';
      select null into l from ls
      where rownum=1 ;
    end;
    /It only worked after I created a local synoynm for ls in the schema APEX_SCM. Weird, it seems like 'alter session set current schema=SIX' is just plain ignored.
    Any help would be greatly appreciated, by anyone ;).
    Thanks,
    ~Dietmar.

  • Expire password - alter user - privilege authid

    Hello to all
    I need to allow the users of Data base, that when the password expires, can enter the new password from a page. What I am trying to do is to add a function to modify the user
    create function usu_mod
    as
    begin
    execute immediate 'alter user pepe identified by pepe2';
    end;
    some idea, raised affluent estaria? also it sends an insufficient error to me of privileges, since apex uses the APEX_PUBLIC_USER. I was looking for and I saw AUTHID DEFINER AUTHID, CURRENT_USER. it is necessary to use some of these commandos, somebody can give an idea me of like using them
    Thank you very much
    Juan Pablo

    Juan - We talked about this here: Re: ORACLE Password Change using APEX FORM
    Scott

  • Expire password - alter user - privilege authid (2) english

    Hello to all
    I need to allow the users of Data base, that when the password expires, can enter the new password from a page. What I am trying to do is to add a function to modify the user
    create function usu_mod
    as
    begin
    execute immediate 'alter user pepe identified by pepe2';
    end;
    some idea, raised affluent estaria? also it sends an insufficient error to me of privileges, since apex uses the APEX_PUBLIC_USER. I was looking for and I saw AUTHID DEFINER AUTHID, CURRENT_USER. it is necessary to use some of these commandos, somebody can give an idea me of like using them
    Thank you very much
    Juan Pablo

    Juan - We talked about this here: Re: ORACLE Password Change using APEX FORM
    Scott

  • How to pass hardcodded value to  current_user

    Hi All,
    I am using AUTHID CURRENT_USER in my pkg. In one case I am login in as a user "C" but I want to pass "CURRENT_USER" as a "B". How can I pass user name "B" even though my current user "C". Any ones help is much appreciated.
    Thanks

    ... but you still might not like it....
    SQL> conn b/b
    Connected.
    SQL> create table t1 (col1 number)
      2  /
    Table created.
    SQL> insert into t1 values (1);
    1 row created.
    SQL> grant select on t1 to a;
    Grant succeeded.
    SQL> conn a/a
    Connected.
    SQL> create or replace procedure p1
      2  authid current_user
      3  as
      4      n b.t1.col1%type;
      5  begin
      6      dbms_output.put_line('user = '||user);
      7      dbms_output.put_line('session_user = '||sys_context('userenv', 'session_user'));
      8      dbms_output.put_line('session_schema = '||sys_context('userenv', 'session_schema'));
      9      dbms_output.put_line('current_user = '||sys_context('userenv', 'current_user'));
    10      dbms_output.put_line('current_schema= '||sys_context('userenv', 'current_schema'));
    11      select col1 into n
    12      from b.t1
    13      where rownum = 1;
    14      dbms_output.put_line('col1='||to_char(n));
    15  end p1;
    16  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec p1
    user = A
    session_user = A
    session_schema = A
    current_user = A
    current_schema= A
    col1=1
    PL/SQL procedure successfully completed.
    SQL> grant execute on p1 to c
      2  /
    Grant succeeded.
    SQL> conn c/c
    Connected.
    SQL> exec a.p1
    BEGIN a.p1; END;
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "A.P1", line 11
    ORA-06512: at line 1
    SQL> conn b/b
    Connected.
    SQL> grant select on t1 to c
      2  /
    Grant succeeded.
    SQL> conn c/c
    Connected.
    SQL> set serveroutput on
    SQL> exec a.p1
    user = C
    session_user = C
    session_schema = C
    current_user = C
    current_schema= C
    col1=1
    PL/SQL procedure successfully completed.
    SQL>Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Logical error in this procedure

    Hi,
    I have creted this procedure when i execute it,
    procedure created successfully, but when i run the procedute then it gives this error
    *ERROR at line 1:
    ORA-00933: SQL command not properly ended
    ORA-06512: at "POI_RELEASE.SPECIAL_YPOL", line 13
    ORA-06512: at line 1
    CREATE or REPLACE PROCEDURE SPECIAL_YPOL
    (tablename IN VARCHAR2,
         fieldname IN VARCHAR2)
    AUTHID CURRENT_USER
    IS
    BEGIN
    EXECUTE IMMEDIATE 'Update '      
                        ||tableName
                        || ' set '
                        ||fieldname
                        ||' =REPLACE('     
                        ||fieldname     
                   ||',CHR(38) || ''QUOT,'',CHR(39)) WHERE'
                        ||FIELDNAME
                        ||'LIKE ''%'' || CHR(38) || ''QUOT,''';
    OMMIT;
    END;
    /

    If this was ancient times, and you wrote this code to run on any of my databases, I would have handed your over to the SQL Inquisition for showing you the error of your ways.
    This is exactly how NOT to write code in Oracle. This is exactly how to cause performance problems in Oracle. This is exactly how to trash and fragment the Oracle Shared Pool. This is exactly how to design code and applications that are fragile and generate weirdly non-wonderful runtime errors.
    On the performance side... this is what I posted not even a week ago to show just how stupid this approach you're using is:
    SQL> create table footab( n number );
    Table created.
    SQL> set timing on
    SQL>
    SQL> -- doing a 100,000 inserts using a bind variable
    SQL> declare
    2 sqlInsert varchar2(1000);
    3 begin
    4 sqlInsert := 'insert into footab( n ) values( :0 )';
    5 for i in 1..100000
    6 loop
    7 execute immediate sqlInsert using i;
    8 end loop;
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:04.91
    SQL>
    SQL> -- doing a 100,000 inserts without using a bind variable
    SQL> declare
    2 sqlInsert varchar2(1000);
    3 begin
    4 -- need to built a unique SQL for each insert
    5 for i in 1..100000
    6 loop
    7 sqlInsert := 'insert into footab( n ) values( '||i||' )';
    8 execute immediate sqlInsert;
    9 end loop;
    10 end;
    11 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:05:21.47
    SQL>So.. you want to turn something that should run in a few seconds, to something that takes several minutes to run.
    Great stuff!! Pardon me, but I think I will need yet another cup of coffee to see me through this morning's browsing of Oracle Forums..

  • No data Found when executing select within a function

    Hi
    I have a select statement based on the USER_ROLE_PRIVS view for a specific granted_role and user, If I execute the statement in SQL/Plus I obtain the required result, however if I put the same select in a function and excute the function signed on as the same user I get ora-00100 no data found. I have granted execute to public on the function. Is there a grant I have missed
    Any Help would be Great
    Tina

    1 CREATE OR REPLACE FUNCTION xyz
    2 Return number IS
      3  v_return number := 0;
      4  v_granted_role user_role_privs.granted_role%type;
      5  BEGIN
      6  Select granted_role
      7  into v_granted_role
      8  from USER_ROLE_PRIVS
      9  where Granted_Role = 'CONNECT'
    10  and username = user;
    11  v_return := 1;
    12  RETURN v_return;
    13  EXCEPTION
    14  when no_data_found then
    15  v_return := 0;
    16  RETURN v_return;
    17  when others then
    18  v_return:= 9;
    19  RETURN v_return;
    20* END;
    SQL> /
    Function created.
    SQL>  declare
      2   n number;
      3   begin
      4   n:=xyz;
      5   dbms_output.put_line('n'||n);
      6   end;
      7   /
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on;
    SQL> /
    n1
    PL/SQL procedure successfully completed.Your supplied code works fine for me - Executing in owner schema. Then only authid current_user is missing in your code
    Edited by: Lokanath Giri on १९ अगस्त, २०१० ६:०२ अपराह्न

  • PL/SQL, Java and  Current User

    Hi there,
    I'm trying to get the following to work :
    Schema HR
    Contains :
    Procedure P_TST_01
    ( p_blob blob
    , p_dir varchar2
    AUTHID CURRENT_USER
    IS
    LANGUAGE JAVA
    NAME 'FileUtil.write(p_blob,p_dir)';
    Java source FileUtil (also with the AUTHID CURRENT_USER clause)
    Now Scott runs (as scott):
    Runs HR.p_tst_01(blob,'/users/scott/')
    When I give HR acess rights to /users/scott , the file gets written to the directory
    However when HR has no rights, but scott has
    then the JavaPolicy is complaining.
    My question is : why isn't the 'authid current_user' clause working as expected.
    Thanks in advance,
    Art

    >>
    begin
    dbms_java.grant_permission
    ('SCOTT',
    'java.io.FilePermission',
    '/users/scott',
    'read,write,execute,delete');
    end;
    connect hr/hr@orcl
    create or replace procedure p_write_blob
    ( p_blob in blob
    , p_dir in varchar2
    AUTHID CURRENT_USER
    IS
    LANGUAGE JAVA
    NAME 'FileUtil.writeBlob(oracle.sql.BLOB,java.lang.String);
    //FileUtil Java source is also created with AUTHID CURRENT_USER
    create public synonym p_write_blob for p_write_blob;
    grant execute on p_write_blob to public;
    connect scott/tiger@orcl
    declare
    pl_blob blob;
    begin
    select img
    into pl_blob
    from images
    where id = 1
    p_write_blob(pl_blob,'/users/scott');
    end;
    java.security.AccessControlException: the Permission (java.io.FilePermission read) has not been granted to HRI expected that since Scott has access rights to /users/scott and the Procedure had invoker rights, that Scott would be writing to the directory.
    However, it looks like invoker rights have no influence on JavaPolicies.

  • Java Program to copy file from one directory to another failing

    Hello All,
    Oracle Applications 12.1.3
    RDBMS: 11.2.0.30
    SQL*Plus: 10.1.0.5.0
    Java beginner here so help is much appreciated.  I'm have some java code that I'm using to copy a file from one directory to another in an Oracle Applications Server.  I notice that when moving to a new instnace I started to get file not found errors.  I think it's because of the directory.  My question is, does the directory in which I trying to pick up the file have to be a DBA_DIRECTORY, or a UTL_FILE directory in order for the java to find the file and move it?
    Here is my code...
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "COPY_FILE_JVS" AS
    import java.io.*;
    public class COPY_FILE_JVC{
      public static void copy(String SourceFile, String DestDir) {
        File source = new File(SourceFile);
        File dest = new File(DestDir);
        File cpDestFile = null;
        try {
          if (dest.isDirectory()) {
              if(source.isFile()) {
                System.out.println("File name = " + source.getName());
                System.out.println("File name dest = " + dest.getPath() );
                System.out.println("File name cpDestFile = " + dest.getPath() + File.separator + source.getName());
                cpDestFile = new File(dest.getPath() + File.separator + source.getName());
              else {
                System.out.println("Directory or File Not Found");
                return;
          BufferedInputStream  br = new BufferedInputStream (new FileInputStream (source));
          BufferedOutputStream  bw = new BufferedOutputStream (new FileOutputStream (cpDestFile));
          int read = 0;
          while((read = br.read()) != -1) {
            //System.out.println((char)read);
            bw.write(read);
          br.close();
          bw.close();
        catch (FileNotFoundException e) {
        e.printStackTrace();
        catch (IOException e) {
        e.printStackTrace();

    I get these messages when calling the java from SQL Plus as follows...
    serveroutput on size 100000;
    dbms_java.set_output(1000000);
    MY_PKG.CopyFile('/home/my_user/set_env.sh','/interface/home'); (this is call to oracle pl/sql package which calls the java.)
    PL/SQL procedure successfully completed.
    Directory or File Not Found
    PL/SQL procedure successfully completed.
    If I change the directory from /home/my_user/ to any directory that is defined in DBA_DIRECTORIES or is a UTL_FILE directory to program works.  Is it perhaps because the java is in a PL/SQL package as seen below?  The PL/SQL program runs as the APPS user and I have issued the following the command grant JAVASYSPRIV to APPS.
    Here is the PL/SQL Package....
    CREATE OR REPLACE PACKAGE BOLINF.MY_PKG AUTHID CURRENT_USER AS
    CopyFile(p_SourceFile IN VARCHAR2, p_DestDir IN VARCHAR2);
    +++++++++++++++++++++++++++++
    CREATE OR REPLACE PACKAGE BODY BOLINF.MY_PKG  is
    CopyFile(p_SourceFile IN VARCHAR2, p_DestDir IN VARCHAR2)
    AS LANGUAGE JAVA NAME 'COPY_FILE_JVC.copy(java.lang.String, java.lang.String)';

  • Apache Error Log mod_security: Access denied with code 400

    Hi
    I am seeing the Access denied with code 400 errors in the apache log's after applying CPU Patch updates below into a Dev/TEST environment
    RDBMS Patches: 9032412 & 9352191 & post steps below:
    @?/rdbms/admin/dbmsaqds.plb
    @?/rdbms/admin/prvtaqds.plb
    @?/rdbms/admin/prvtaqiu.plb
    Java Fix > [ID 1082747.1]
    E-Business Suite Patches & post steps below:
    9323613 & 9506302
    Compiled Forms PLL files using adadmin to solve the known problem below
    ORA-04062: signature of package "APPS.FND_HELP" has been changed
    ORA-04062: KEY-HELP trigger raised unhandled exception ORA-04062.
    the error can be replicated by following the steps below:
    Log in to Oracle Apps E-Business Suite (11.5.10.2) select Report Management Information Responsibility and then transaction reports. (Opens Oracle Discoverer 4i Viewer) > select either Period to date or Year to date and then select any department & and any period (date) and then apply parameters:
    Error message in browser
    This error (HTTP 400 Bad Request) means that Internet Explorer was able to connect to the web server, but the webpage could not be found because of a problem with the address.
    For more information about HTTP errors, see Help.
    Apache log shows:
    error_log shows the following:
    [Fri Jul  8 10:52:08 2011] [error] [client 10.180.225.5] mod_security: Access denied with code 400. Pattern match "!^([-_@|#!=A-Za-z0-9/ :.$/(/)]){0,255}([-_@|#!=A-Za-z0-9/ :.$]){0,255}$" at ARGS_NAMES. [hostname "loadbalancer.webdomain"] [uri "/discoverer4i/viewer"] [unique_id ThbTSAq0BRQAABrfK7M]
    access_log shows the following:
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/shadow_bottom02_leading_ltr.gif HTTP/1.1" 200 861 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/seperator.gif HTTP/1.1" 200 42 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/arch_blue_bottom_ltr.gif HTTP/1.1" 200 984 0
    10.180.225.5 - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/white.gif HTTP/1.1" 200 37 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/bar_blue_leading_edge_middle_ltr.gif HTTP/1.1" 200 111 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/bar_blue_trailing_edge_middle_ltr.gif HTTP/1.1" 200 129 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/shadow_bottom_leading_edge_ltr.gif HTTP/1.1" 200 862 0
    IP ADDRESS - - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/btopshadow.gif HTTP/1.1" 200 44 0
    IP ADDRESS- - [08/Jul/2011:10:51:39 +0100] "GET /disco4iv/html/images/bshadow.gif HTTP/1.1" 200 59 0
    IP ADDRESS - - [08/Jul/2011:10:52:08 +0100] "POST /discoverer4i/viewer HTTP/1.1" 400 227 0
    I have tried to follow a number of metalink notes but unable to resolve this issue, metalink notes looked at are:
    976473.1
    389558.1
    1313128.1 Patch 10324904 applied
    394587.1
    389558.1 Patch 5107107 applied
    1143882.1
    376992.1 Patch 3950067 applied
    Any ideas or suggestions most welcome
    Thank you
    Regards
    Arfan
    Edited by: user1717313 on 08-Jul-2011 04:59

    Hi JD
    I have tried the steps i.e stop apps tier, run adconfig on apps tiers and then started services on apps tiers and can replicate the error
    thanks
    Arfan
    Hi Helios
    I checked note 1080465.1 Patch 9506302 has been applied & Recompile all Forms PLL files using adadmin.
    I ran the sql feom the note, output below
    SQL> select text from dba_source where name='FND_HELP' and line <3;
    TEXT
    package Fnd_Help AUTHID CURRENT_USER as
    /* $Header: AFMLHLPS.pls 115.22 2009/10/12 12:56:58 nchiring ship $ */
    package body FND_HELP as
    /* $Header: AFMLHLPB.pls 115.115 2010/03/19 06:45:24 nchiring ship $ */
    Thanks
    Arfan
    Edited by: user1717313 on 08-Jul-2011 05:04

  • Oracle dbms.set_role does not work in APEX application

    Hi, in our j2ee applications, we use secure application role. Basically, the data source use the app user schema to connect to the database. the app user only has create session privileges. the database logon trigger will copy a set of attribute to the local secure context. (ip address, session user, client id, application name). The applications explicitly invoke the stored procedure sec_mgr.set_role before any DMLs are executed.
    the sec_mgr.set_role will check the local context attribute , authorize the ip, application name, and set an appreciated role to this session based on session user.
    we want to apply the same framework to the APEX application. First, we change the paring schema to the app schema which only has create session privilege. then we put the plsql code in which sec_mgr.set_role is called in the application builder --> shared components ---> edit security attribute ---> Virtual Private Database (VPD).
    however, we got the error ORA-06565: cannot execute SET ROLE from within stored procedure
    the sec_mgr.set_role is defined as invoker's right(AUTHID CURRENT_USER)
    do i missing something in APEX to get it work?
    Thanks

    Please explain it does not work in APEX? Is the application updating tables that have a trigger? APEX does NOT override trigger actions. Is it possible the values your trigger is looking for are NOT available in your APEX application? Can you post the trigger code here for review?
    Thank you,
    Tony Miller
    Webster, TX
    What if you really were stalking a paranoid schizophrenic... Would they know?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • How can I see the contents in a Ref Cursor

    I have this code:
    CREATE OR REPLACE PACKAGE APOD_LOG.APOD_C3_LOG_API_PKG
    AUTHID CURRENT_USER
    AS
    type rc is ref cursor;
    PROCEDURE Fetch_Log_Spec
    in_LOCAL_IP_VALUE IN BINARY_INTEGER,
    out_RESULT_SET OUT rc
    END APOD_C3_LOG_API_PKG;
    CREATE OR REPLACE PACKAGE BODY APOD_LOG.APOD_C3_LOG_API_PKG
    AS
    PROCEDURE Fetch_Log_Spec
    in_LOCAL_IP_VALUE IN BINARY_INTEGER,
    out_RESULT_SET OUT rc
    IS
    BEGIN
    DBMS_APPLICATION_INFO.set_module(module_name => 'APOD_LOG.API_PKG',action_name => 'Fetch_Log_Spec');
    DBMS_APPLICATION_INFO.set_client_info(client_info => 'Calling with in_LOCAL_IP_VALUE = ' ||to_char(in_LOCAL_IP_VALUE));
    open out_RESULT_SET for
    select
    in_LOCAL_IP_VALUE as IN_LOCAL_IP_VALUE,
    10002 as PORT,
    APOD_CORE.UTIL_IP_PKG.IPAddressToIPValue2('''224.168.100.1''') as MULTICAST_IP_VALUE
    from
    dual
    union
    select
    in_LOCAL_IP_VALUE as IN_LOCAL_IP_VALUE,
    10002 as PORT,
    APOD_CORE.UTIL_IP_PKG.IPAddressToIPValue2('''224.168.200.1''') as MULTICAST_IP_VALUE
    from
    dual
    union
    select
    in_LOCAL_IP_VALUE as IN_LOCAL_IP_VALUE,
    10002 as PORT,
    APOD_CORE.UTIL_IP_PKG.IPAddressToIPValue2('''224.168.100.123''') as MULTICAST_IP_VALUE
    from
    dual
    union
    select
    in_LOCAL_IP_VALUE as IN_LOCAL_IP_VALUE,
    10002 as PORT,
    APOD_CORE.UTIL_IP_PKG.IPAddressToIPValue2('''224.168.200.123''') as MULTICAST_IP_VALUE
    from
    dual;
    DBMS_APPLICATION_INFO.set_client_info(client_info => 'Called Fetch_Log_Spec '||to_char(SQL%ROWCOUNT)||' row(s) returned with in_LOCAL_IP_VALUE = '||to_char(in_LOCAL_IP_VALUE) );
    END Fetch_Log_Spec;
    END APOD_C3_LOG_API_PKG;
    And I am trying to test it like this:
    DECLARE
    IN_LOCAL_IP_VALUE BINARY_INTEGER;
    OUT_RESULT_SET APOD_LOG.APOD_C3_LOG_API_PKG.rc;
    BEGIN
    IN_LOCAL_IP_VALUE := 23374048;
    -- OUT_RESULT_SET := NULL; How do I see this
    APOD_LOG.APOD_C3_LOG_API_PKG.FETCH_LOG_SPEC ( IN_LOCAL_IP_VALUE, OUT_RESULT_SET );
    END;
    How can I see the dataset returnd by the OUT_RESULT_SET in SQLPlus or Quest ScriptRunner?

    A ref cursor doesn't really contain rows but you can use them to reference a SQL statement that fetches the rows.
    Re: returning resultset from procedure...or pkg

Maybe you are looking for