Pl/sql block to access v$ views

Hi All,
i am doing this on both 10 g and 11 g but having same issue. I am trying to run below procedure and i am getting the error ORA-00942: table or view does not exist
CREATE OR REPLACE PROCEDURE DB_INFO(V_DB VARCHAR2, CUR1 OUT SYS_REFCURSOR)
AS
v1 varchar2(2000);
BEGIN
v1='SELECT A.DBID, A.NAME, B.VERSION, B.HOST_NAME FROM V$DATABASE@'||V_DB||' A, V$INSTANCE@'||V_DB||' B WHERE A.NAME=B.INSTANCE_NAME';
open cur1 for v1;
end db_info;
Assume this procedure is present in X DB. I have two confusions regarding this:
1) When i run that select statement seprately in sql. It runs fine and give me result if i use any value for v_db.
SELECT A.DBID, A.NAME, B.VERSION, B.HOST_NAME FROM V$DATABASE@X A, V$INSTANCE@X b WHERE A.NAME=B.INSTANCE_NAME;
2) This procedure executes successfully and returned me cursor if i pass any value for v_db except X (DB in which this procedure is present).
If I pass value of v_db as X, it gives me error ORA-00942: table or view does not exist . It shows v$database and v$instance does not exist for same database X in which this procedure is present.
This seems to be strange. I am not sure about what is causing this issue. Please provide me some information regarding that and lemme know on how i can fix this.
All your comments and responses will be greatly appreciated.
Regards
Dev

Hi,
Keen2Learn wrote:
Hi Frank/sb92075,
Thank you for this explanation. But i am still confused.
I create this sp in two dbs X and Y.
In DB X, when i call this sp passing v_db as X, then it is giving that error, table does not exist but when i pass v_db as Y, then it is running fine.
Now In DB Y, when i call this sp passing v_db as Y, it is giving that error, table does not exist but when i pass v_db as X, then it is running fine.One explanation is that the links X and Y are not the same in the different databases.
If there are missing privileges, then why it is not giving error when run it in other DB passing same DB name.I must not understand the question.
If it works in some database, then the tables really exist and the procedure owner in that database has the right privileges.
If it deos not work in some database, then the tables don't really exist or the procedure owner in that database does not have the right privileges.
I am only confused about this thing that why it is giving error, when we pass same DB name in which this sp exists?
Please let me know what exactly need to be done to fix this.As always, post a complete test scrpt that we can run to re-create the problem and test our ideas. Include CREATE TABLE, GRANT, CREATE PROCEDURE, CREATE DATABASE LINK, and whatever other statements are necessary to show the proble. Include CONNECT and EXECUTE statements to re-create the problem.
I know it's not easy to produce all that, but without it, I don't really understand the problem.

Similar Messages

  • Access a view on a 32 bit Oracle 9i  from a MS SQL 2008 R2 64 bit

    NOt sure if this is the right forum for this.
    We need to access a view on a 32 bit Oracle 9i - Release 9.2.0.8.0 database running on Windows 2003 Server, from a MS SQL 2008 R2 64 bit system running on Windows Server 2008 64 bit.
    Edited by: 854859 on Apr 26, 2011 3:21 PM

    When yu want to access a view hosted in Oracle and retrieve data from this view in a MS SQl Server, then you need to use MS SQL Server Linked Server mechanism based on OLEDB/ODBC.
    Since MS SQL Server this feature is integrated in MS Integration Services and more details can be found at the MS knowledge base.

  • Need to refresh materialized view from procedure and pl/sql block

    Hi,
    I need to refresh materialized view (complete refresh)from procedure and pl/sql block .can some one help.
    MV name:MV_DGN_TEST_SESSION
    Thanks,
    Rajasekhar

    dbms_mview.REFRESH ('MV_DGN_TEST_SESSION', 'C');Regards,
    Mahesh Kaila
    Edited by: user4211491 on Dec 1, 2009 10:41 PM

  • Access to view  without a blocked

    Hi, i need access a view by sm30 2 or more times without a blocked
    thanks

    Hi
    This is my program for SM30 in order to set a my own lock
    A) SE11
    - I've created a maintenance view for my Z-table
    - I've set the fields I need to lock available for SUBSET
    - I've set the view Display "Maintenance allowed with Restrictions"
    - I've generated the maintenance program for SM30
    - I've implemented the event 19 in order to set my lock
    B) I've created a Z-program in order to call the view above by fm VIEW_MAINTENANCE_CALL:
    this fm is always called for DISPLAY only (in this way no standard lock will be set)
    C) The code I've set in event 19:
    DATA: BEGIN OF MY_LOCK,
              MANDT       TYPE <table>-MANDT  "<---Structure with fields I need to lock
            END OF MY_LOCK.
      DATA: W_SEL_LIST TYPE VIMSELLIST.
      DATA: VARKEY TYPE RSTABLE-VARKEY.
      FIELD-SYMBOLS: <MY_KEY> TYPE ANY.
      LOOP AT DBA_SELLIST INTO W_SEL_LIST
        WHERE VIEWFIELD = '<field name ....>  "All fields of structure above
              OR VIEWFIELD = '<field name ....> .
        ASSIGN COMPONENT W_SEL_LIST-VIEWFIELD
           OF STRUCTURE MY_LOCK TO <MY_KEY>.
        IF SY-SUBRC = 0.
          MOVE W_SEL_LIST-VALUE TO <MY_KEY>.
        ENDIF.
      ENDLOOP.
      IF SY-SUBRC = 0.
        IF NOT MY_LOCK IS INITIAL.
          MY_LOCK-MANDT = SY-MANDT.
          VARKEY = MY_LOCK.
          CALL FUNCTION 'ENQUEUE_E_TABLEE'
            EXPORTING
              MODE_RSTABLE   = 'E'
              TABNAME        = <table name>
              VARKEY         = VARKEY
            EXCEPTIONS
              FOREIGN_LOCK   = 1
              SYSTEM_FAILURE = 2
              OTHERS         = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSE.
            MAINT_MODE = VIEW_ACTION = 'U'. "Change SM30 for UPDATING
          ENDIF.
        ENDIF.
      ENDIF.
    So I haven't used the event 14, bat you can try to use the code above in that event, but in this case you have to add the code to delete the standard lock for the full table.
    Max

  • PL/SQL block query error when going to a remote system with 1 parameter.

    Hi,
    I am getting the error:
    Invalid function body condition: ORA-01460: unimplemented or unreasonable conversion requested ORA-02063: preceding line from HANSEN_REMOTE
    The issue appears to result from opening a cursor that is a select statement is in some way accessing records via a dblink and the 'where' clause is has more then one session parameter in it. Here is the smallest pl/sql block that results with an error:
    DECLARE
    CURSOR c_GetPay IS
    SELECT PERSON_ID
    FROM CASH_PERSON@HANSEN_REMOTE
    WHERE LAST_NAME = :P320_HANSEN_LAST_NAME
    AND FIRST_NAME = :P320_HANSEN_FIRST_NAME;
    BEGIN
    OPEN c_GetPay ;
    CLOSE c_GetPay ;
    RETURN TRUE;
    END ;
    If I remove 'AND FIRST_NAME = :P320_HANSEN_FIRST_NAME' from the curser, there is no problem. This block of pl/sql is in a On Load: Before Header
    on a page branch. This issue remains consistent in our 1.6.1.00.02 instance of HTMLDB with an Oracle database version 10.1.0.3.0. This instance is
    a fresh install of the 10g and HTMLDB.
    Does any one have any ideas of why I am getting this error message. I really need to get it resolve soon as we are trying to get an application up by the end of August and there is still alot of coding needing to be done.
    Thanks for the help.
    Lanie

    Scott, I have tried everything that this point except copy the whole table from the remote system.
    Here is a short version of what I have tried...
    -- hard coded condition...timing was not an issue here...it was quick.
    declare
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like 'LANIE'
              AND last_name LIKE 'MOORE'
    BEGIN
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END           
    -- this is an internal variable set to the string literal...does not as the v function was not called.
    declare
    V_TEST VARCHAR2(150);
    V_TEST2 VARCHAR2(150);
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like :V_TEST
              AND last_name LIKE :V_TEST2
    BEGIN
    V_TEST := 'LANIE';
    V_TEST2 := 'MOORE';
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END
    -- this has the v function called in the cursor since no matter what I do, I have to call it so I don't get my original error. This takes over a minute to return, and it is using hard coded values...if I use session variables where I place the information from the user, it takes even longer.
    declare
    V_TEST VARCHAR2(150);
    V_TEST2 VARCHAR2(150);
    v_in_PersonId number(9);
    cursor c_GetPay
    IS select PERSON_ID --, first_name, LAST_NAME
         from HANSEN_CONTACT
              where first_name like V(:V_TEST)
              AND last_name LIKE V(:V_TEST2)
    BEGIN
    V_TEST := 'LANIE';
    V_TEST2 := 'MOORE';
    OPEN c_GetPay;
    FETCH c_GetPay INTO v_in_PersonId;
    CLOSE c_GetPay;
    RETURN TRUE;
    END
    It does not appear to be an issue if I am looking at a view going to the remote system or the table it's self. The slowness issue takes place. (In short I have tried replacing HANSEN_CONTACT which is a view with the direct table link of imsv7.contact@HANSEN_REMOTE and that did not solve the timing issue).
    Any ideas?

  • Db_link name and synonym in PL/SQL block

    Hi,
    I'm having a problem with synonyms in PL/SQL block.
    Say, I have two schemas A and B.
    In schema A, I create some tables and stored procedures.
    In schema B, I create a db link connecting to schema A. Then I create some synonyms for tables and stored procedures in schema A with the db link. In stored procedures created in schema B, I need to access or reference objects in schema by using synonyms.
    My problem is, if schema A and schema B reside on the same db instance and the instance's global_names is set to true, I will not be able to reference any synonyms in stored procedures created in schema B. The error message is,
    PL/SQL: ORA-00980: synonym translation is no longer valid.
    A simple example:
    In schema A,
    create table mytable (A char(2));
    In schema B,
    create database link <global_name-for-schema-A>@loopback connect to A identified by <A-pwd> using '<net-service-name-for-schema-A>';
    create synonym mytable for mytable@<global_name-for-schema-A>@loopback;
    declare
    a char;
    begin
    select * from mytable;
    end;
    But I have no problem to access the synonym-ed objects in SQL*PLUS.
    Please help.
    Thanks

    I had the similar problem i did a work around like below
    SQL>select max(col1) from tab1;
    MAX(COL1)
    21161910
    SQL>get a
    1 declare
    2 a number;
    3 begin
    4 select max(col1) into a from tab1;
    5 dbms_output.put_line(a);
    6* end;
    SQL>@a
    select max(col1) into a from tab1;
    ERROR at line 4:
    ORA-06550: line 4, column 1:
    PL/SQL: ORA-00980: synonym translation is no longer valid
    ORA-06550: line 4, column 1:
    PL/SQL: SQL Statement ignored
    Created a view on top of the synonym
    SQL>create or replace view tab1_v as select * from tab1@db1;
    View created.
    changed the pl/sql block as below to get it from view instead of synonymn
    declare
    a number;
    begin
    select max(col1) into a from tab1;
    dbms_output.put_line(a);
    end;
    Now it worked
    SQL>@a
    21161910
    PL/SQL procedure successfully completed.

  • How to update PL/SQL block/Specs in Repository without cut/paste ?

    (cross-posted in METALINK form also)
    Hello,
    Question: How to quickly update PL/SQL block/specs in a package
    Repository Object Browser? (without cut/paste)
    Tools: Designer 9i, ROB 9.0.2.6
    Detailed description of a problem:
    -- there is no good pl/sql IDE working with ROB
    (JDeveloper can not work with NOT PRIVATE repository workspace)
    -- I use Toad and develop/generate pl/sql object
    directly in database.
    -- I have to synchronize my work with repository as often
    as possible the following way (we do not use read-server model
    because afraid of getting 1000s of atomik func and proc):
    ---- navigate to the pl/sql package
    ---- select properties
    ---- click on pl/sql block - get old code in editor
    ---- copy all new code from Toad into editor
    ---- remove CREATE OR REPLACE and last line
    ---- save
    ---- do the same with specifications
    I am looking for some way to do this with some script or
    one-button click...
    For example, for text files it is possible to use command line
    Repository Tool. But I did not found the possibility to make
    a script like this:
    checkout
    update workarea/container/plsql_definition/package_name/body....
    .....with new_package_body.txt
    checkin
    Thanks in advance for any help/advice,
    Alex V.

    Hi Alex,
    I just had an "Ah! I see!" moment. I now understand why you're having trouble and I can explain things so you can move on... I hope!
    First it's important to understand that Oracle SCM is designed to support versioning of both files and Oracle Designer objects. Designer objects are stored as rows in specially structured tables that support that specific product. When you look at PL/SQL definitions in the RON you're looking at Designer definitions - not files. As I mentioned before, these are not the definitions of 'real' PL/SQL objects in the data dictionary, but definitions used by Designer (from which the real things can be generated - but that's another story).
    If you're using TOAD you should probably avoid accessing the Designer objects. You need to work with files.
    Here's a suggestion for a sequence of operations:
    - In the RON check out & download the file (e.g. mypkg.plb)
    - In TOAD load the package (from DB, or downloaded file), edit, update package in DB
    - In TOAD save as mypkg.plb (overwriting the downloaded copy)
    - IN RON upload mypkg.plb and check in
    If you've not stored the file in Oracle SCM yet, jsut omit the first step.
    You could even automate this to an extent using SQL to query the data dictionary views (e.g. USER_SOURCE) after making changes to get the code and edit/overwrite the file contents that way.
    Does this help at all?
    Keith.

  • PL/SQL: ORA-00942: table or view does not exist

    Hi
    i have logged into my schema and trying to access the database "DAD" which has the table name "SCHOOL"
    i wrote a function which should give me new_sno when i give it the old_sno
    and i have this errors , pls help
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    NEW_SNO Number:=0;
    BEGIN
    SELECT new_sno AS NEW_SNO
    FROM DAD.SCHOOL
    WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN NEW_SNO;
    END ORIG_SN;
    Warning: Function created with compilation errors.
    Errors for FUNCTION ORIG_SN:
    LINE/COL ERROR
    5/1 PL/SQL: SQL Statement ignored
    6/15 PL/SQL: ORA-00942: table or view does not exist
    Thanks in advance ..

    Try this,
    CREATE VIEW SCHOOL_VIEW AS SELECT * FROM DAD.SCHOOL;and then change your function like
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    my_new_sno Number:=0;
    BEGIN
    SELECT new_sno INTO my_new_sno FROM SCHOOL_VIEW WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN my_new_sno;
    END ORIG_SN;and see if it is getting created without any errors.
    -Arun
    Edited by: Arunkumar Ramamoorthy on Aug 15, 2009 1:56 AM

  • We need to access a view on a 32 bit Oracle 9i  - Release 9.2.0.8.0 databas

    Hi
    I don't know if this is the correct forum:
    We need to access a view on a 32 bit Oracle 9i - Release 9.2.0.8.0 database running on Windows 2003 Server, from a MS SQL 2008 R2 64 bit system running on Windows Server 2008 64 bit.
    The DBA for one of the vendors involved has concluded that it is not possible to link from 64 bit MS SQL to a 32 bit Oracle install.
    If it is possible, can you advice what we need to do. Thank you.

    Wrong forum.
    Only solution I can think to actually get to the view.
    1. SQL Server, in TSQL, alllows access to ODBC driver
    2. Use a ODBC driver that can access Oracle (which probably means any SQL driver that will install.)

  • Can't create a sequence within a pl/sql block with execute immediate.

    Hi All. I created a user and granted it the 'create sequence' privilege though a role. In a pl/sql block I try to create a sequence using 'execute immediate' but get a 1031-insufficient privileges error. If I grant create sequence directly to the user, the pl/sql block completes successfully. Can anyone explain this behavior? We're running 11.2 Enterprise Editon.
    Thanks,
    Mark

    In a definer's rights stored procedure (the default), you only have access to privileges that have been granted directly, not via a role.
    There are two basic reasons for that. First, roles can be enabled or disabled, default and non-default, password-protected, etc. so the set of roles a particular user actually has is session-specific. Oracle needs to know at compile time what privileges the owner of the procedure has. The only way to do that (without deferring the privilege check) is to ignore privileges granted through roles.
    Second, since 99% of privilege management DBAs do involves granting and revoking roles, it's helpful that changing role privileges will never cause objects to be marked invalid and recompiled which can have side-effects on applications. DBAs only need to worry about causing problems on those rare cases where they are granting or revoking direct privileges to users.
    You can create an invoker's rights stored procedure by adding the clause (AUTHID CURRENT_USER). That defer's the security check to run-time but allows the procedure to see privileges granted through roles in the current session. But that means that the caller of the procedure would need to have the CREATE SEQUENCE privilege through the role, not the owner of the procedure.
    And just to make the point, dynamic object creation in PL/SQL is almost always a red flag that there is something problematic in your design. If you are creating sequences dynamically, that means that you'd have to refer to them dynamically throughout your code which means that your inserts would need to use dynamic SQL. That's not a particularly easy or safe way to develop code.
    Justin

  • PL/SQL Block for Data Formatting

    I have created a Report that will pull all times that a person clocks in and clocks out. It works great but now accounting wants me to do some "conditional formatting" that can't be done by Report's built in conditional formatting capabilities. I talked to tech support yesterday and they suggested a PL/SQL block to format my times to do what accounting needs. Here is the skinny: All times in the database are done in 100ths of an hour. I need to the times up or down to the next quarter hour depending on when they clocked in. If they clocked in one minute late, it rounds down the the previous quarter hour and anything later and it rounds up. Can someone help me? Thanks, Jeremy

    In the data model, enter your query and create the groups you need.
    Let's say you have the number column my_time in a group named g_times.
    Then create a formula column in the group g_times and look at its
    properties. Change the name to cf_time.
    Click on the property PL/SQL-Formula, and in the pl/sql editor you can
    write something like
    function CF_TIMEFormula return Number is
    begin
      return trunc((:my_time + 0.23) * 4) / 4;
    end;As you see, you can access query columns by using the colon.
    Afterwards, you can display :cf_time in your Layout model.

  • Pl/sql block reading reading table data from single point in time

    I am trying to figure out whether several cursors within a PL/SQL block are executed from within a Single Point In Time, and thus do not see any updates to tables made by other processes or procedures running at the same time.
    The reason I am asking is since I have a block of code making some data extraction, with some initial Sanity Checks before the code executes. However, if some other procedure would be modifying the data in between, then the Sanity Check is invalid. So I am basically trying to figure out if there is some read consistency within a PL/SQL, preventing updates from other processes to be seen.
    Anyone having an idea?.
    BR,
    Cenk

    "Transaction-Level Read Consistency
    Oracle also offers the option of enforcing transaction-level read consistency. When a transaction runs in serializable mode, all data accesses reflect the state of the database as of the time the transaction began. *This means that the data seen by all queries within the same transaction is consistent with respect to a single point in time, except that queries made by a serializable transaction do see changes made by the transaction itself*. Transaction-level read consistency produces repeatable reads and does not expose a query to phantoms."
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=read+consistency&tab_id=&format=ranked

  • Copy Command in Pl/Sql block

    Can I use Copy command in Pl/Sql.For example :-
    Declare
    cursor c1 is select table_name from all_tables
    where owner = 'LSP' and rownum = 1;
    v1 varchar2(2000);
    Begin
    for c2 in c1 loop
    v1:='copy from lsp/lsp123479@dvlaq to scott/[email protected] create '|| c2.table_name ||' using select * from '||c2.table_name;
    execute immediate v1;
    end loop;
    end;
    Its not running properly giving an error as invalid Sql statement .
    Is it bcoz Copy command cannot be used in a Pl/Sql Block.

    Is there any other way to move the Table & data to another Data Base .Database link is the obvious one. And the SQL statement would look something like this (on the target database):
    SQL> create table FOO nologging as select * from FOO@sourcedb;
    However, the first question I always ask if why? What one may think is the solution to a problem is not always the best solution. So one need to identify the problem first, and then see what solutions there are and which one is the best fit.
    Other options are replication (using materialised views for example), Data Pump (available with 10G) - even could be Data Guard, a standby database, or a Real Application Cluster... depending on just what the problem and actual requirements are.
    Also important to note that SQL*Plus has its own set of commands. Do not confuse these commands (like EXEC, COPY, CONNECT, HOST etc) with the SQL and PL/SQL Languages. Not only are they executed by different software products, SQL*Plus commands are executed on the client and SQL (and PL/SQL) runs inside the Oracle database instance.

  • How to search source of pl/sql block in database?

    Hi Guys,
    We have an issue in database, there is PL/SQL block running in my database as below which deleting very important historical data.
    begin
    loop
    delete from tabl_name where created_date<sysdate -100 and ronum<10000;
    EXIT WHEN SQL%NOTFOUND;
    commit;
    end loop;
    end;
    I tried following,
    1) I found this block in v$sqlarea
    2) I searched in dba_source,user_source,all_source but no luck.
    3) I checked all the triggeres but no luck.
    4) I checked all the cron entries for oracle/root/app owner in os but no luck.
    5 I checked all the jobs in dba_jobs but no lcuk
    would appreciated if anyone can assist on this.
    I want to disable/remove this query to be executed.
    Regards,
    Rikki

    For ASH,
    I am trying to confirure the OEM and not able to access the OEM from remotely. However any idea from commad prompt.
    I believe there is a script ashrpt.sql but while running this script format is not supporting.
    any idea if you have run it before.
    I agree for log miner utilities, but I need to configure the UTL dir and need to bounce it and its a critical production environment so looking for alternatives. if not possible I would go for this option.
    It seems ASH report is being geneated lets see how does it go.
    Regards,
    Pradeep
    Edited by: user13049723 on Jul 26, 2010 8:07 PM

  • Cursor query retrieves records in anon pl/sql block but no data in store pr

    Hello,
    Can any one please help me,
    I am using the below query, to get the table name and constraint name
    select table_name,constraint_name
    from all_constraints
    where constraint_type in ('R','P')
    and status = 'ENABLED'
    and owner='IRIS_DATA'
    order by constraint_type desc;
    The below query retrieves data in anonymous pl/sql block and retrieve no data when i use the same cursor with the same query in procedure inside the package.
    CREATE USER CLONEDEV
    IDENTIFIED BY CLONE123
    DEFAULT TABLESPACE IRIS
    TEMPORARY TABLESPACE TEMP;
    GRANT DBA TO CLONEDEV;
    the user from which i am executing this query is granted dba role.
    My oracle version is 10.2.0.4
    Please update if you any other information.
    Please advice.
    Thanks

    >
    Roles cannot be used by pl/sql.
    >
    NOT TRUE!
    That is an oft quoted myth. There are many posts in the forum that mis-state this.
    Roles can be, and are used by PL/SQL. In fact, OP stated and demonstrated that in their question: their anonymous block worked.
    The Oracle docs provide a very clear explanation - the core restriction is for NAMED PL/SQL blocks that use DEFINER's rights (the default):
    >
    Roles Used in Named Blocks with Definer's Rights
    All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
    >
    The Database Security Guide has the information in the section 'How Roles Work in PL/SQL Blocks (which, of course, wouldln't be needed if they didn't work. ;) )
    http://docs.oracle.com/cd/B28359_01/network.111/b28531/authorization.htm#i1007304
    >
    The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and whether it executes with definer's rights or invoker's rights.
    Roles Used in Named Blocks with Definer's Rights
    All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
    The SESSION_ROLES view shows all roles that are currently enabled. If a named PL/SQL block that executes with definer's rights queries SESSION_ROLES, then the query does not return any rows.
    See Also:
    Oracle Database Reference
    Roles Used in Named Blocks with Invoker's Rights and Anonymous PL/SQL Blocks
    Named PL/SQL blocks that execute with invoker's rights and anonymous PL/SQL blocks are executed based on privileges granted through enabled roles. Current roles are used for privilege checking within an invoker's rights PL/SQL block. You can use dynamic SQL to set a role in the session.

Maybe you are looking for

  • Videos shot on my iPhone 3GS aren't getting imported into iPhoto

    Videos I've shot on my iPhone 3GS aren't importing into iPhoto - but the photos are. Noticed this a few weeks ago, believe it occurred as a result of my migration from my old MBP to my new one in mid Jan of this year. Did a rebuild of iPhoto, killed

  • Problem with users search

    Hello, I'm trying use the tasks functionality in portal however when I try to get the user to assign te task the search don't returns anything. I've used the standard demo also and it doesn't work, has somebody got this problem? thanks Wagner Moreira

  • Width of Component - Regardless of Internal 'includeInLayout'

    Hey there, I'm curious to know if there is a way to obtain the width of a component in Flex, that will disregard the 'includeInLayout' property. Example: If I have two rectangles in a component, side by side. One rectangle has a width of 10, the othe

  • Is there any hope for my 5S after it's dip?

    Hi All I dropped my 5S in water two days ago.  I got it out in seconds, powered it off, dried it with a cloth, removed sim, and shook all water out and placed it in rice.  It's been in the rice in the airing cupboard for 48 hours.  So I took it out a

  • Windows 7 64bit Photosmart All-in-one C6380 Solution Center Issue

    Finally stumbled on re-installing printer SW so I was able to bring up the Solution Center page after a week of effort.  The problem is it errors out after clicking on the scan buttons for either pictures or documents with the following dialog box po