What is the problem with this pl/sql code?

What is the problem with this statement of the cursor? I am getting PLS-00341 error for her:
CURSOR cur_rsource(p_sql_stmt IN VARCHAR2) IS
        SELECT plan_table_output FROM v$sql s, table(dbms_xplan.display_CURSOR(s.sql_id, s.child_number)) t WHERE sql_text LIKE '''%'||p_sql_stmt||'%''';
How to solve this problem?

Thank you

Published by: PhoenixBai on December 14, 2009 14:05

I don't have time right now to study exhaustively, but for me his vomit ORA-00942 table or view does not exist on this line:

    SELECT sql_id, child_number into tmp_sql_id, tmp_child_number
         from v$sql where sql_text like sql_statement||'%' and sql_text not like '%v$sql%';

I am able to select from v$ sql in normal SQL as user I am compiling as, so don't know why it's complaing.

Anyone know if there are certain restrictions on access to the views v$ through PL/SQL?

EDIT: http://www.dbasupport.com/forums/showthread.php?t=22299

Access to the views of $ v seems to be through a role - try giving explicit access to it.

As SYS, you must grant select permissions on V_$ SQL (V$ SQL is synonymous with V_$ SQL) to your owner of the procedure. Just tested on my system and it allows him to compile.

Published by: Cyn on December 14, 2009 10:30

Tags: Database

Similar Questions

  • What is the problem with this piece of code?

    Security.allowDomain("you/tube.com"); var my_player:Object;

    var my_loader:Loader = new Loader();

    my_loader. Load (new URLRequest("yout/ube.com/v/xe95yC_nsDI?version=3"));

    my_loader. = contentLoaderInfo.adfunction (Event.INIT, onLoaderInit);

    function onLoaderInit(e:Event):void {addChild (my_loader);

    my_player = my_loader.content; my_player.addEventListener ("onReady", onPlayerReady);

    }

    function onPlayerReady(e:Event):void {my_player.setSize (520,290);}

    }

    If you want to help troubleshooting code you should present correctly implemented with withdrawal form and separate lines for different actions.

    I see a number of errors in these two lines only...

    my_loader. Load (new URLRequest("yout/ube.com/v/xe95yC_nsDI?version=3"));

    my_loader. = contentLoaderInfo.adfunction (Event.INIT, onLoaderInit);

    (1) who cannot be a valid address of youtube with the slash in there

    (2) who dot leading contentLoaderInfo is a mistake

    (3) I don't know of a method called adfunction, and if I paste this line it turns into something with a dash in the name of this method

  • What is the problem with this PL/SQL block

    declare
    v_count integer: = 0;
    Start
    -immediate ' select count (1) in v_count of | "abc". '.table1 ';
    run immediately ' select count (1) in abc.table1 v_count;
    dbms_output.put_line ('v_count: ' | v_count);
    end;

    When I execute the pl/sql block above, I get the following error:
    ORA-00905: lack of keyword
    ORA-06512: at line 6

    What I am doing wrong?
    When I use SELECT COUNT (1) INTO v_count FROM abc.table1; (instead of the dynamic sql), it works.
    I know I can't use run immediately to SELECT, but I need to make the dynamic SQL because table1 will be developed according to several drawings.

    Would appreciate an explanation of the error above, or alternate solution (s) SQL dynamic.

    Thank you
    DECLARE
      v_count INTEGER := 0;
    BEGIN
      -- execute immediate 'select count(1) into v_count from ' || 'abc' || '.table1';
      EXECUTE IMMEDIATE 'select count(1)  from abc.table1' into v_count;
      dbms_output.put_line('v_count: ' || v_count);
    END;
    

    TEST

    DECLARE
      v_count INTEGER := 0;
    BEGIN
      -- execute immediate 'select count(1) into v_count from ' || 'abc' || '.table1';
      EXECUTE IMMEDIATE 'select count(1) from dual ' into v_count;
      dbms_output.put_line('v_count: ' || v_count);
    END;
    /
    v_count: 1
    
    PL/SQL procedure successfully completed.
    

    HTH
    SS

  • How I download 80070103 windows update is update safe what is the problem with this update

    Just got the update installation today to download update 80070103 time ever I go to download the update fail what is the problem with this update & how do I get updated.

    Hello

    Thanks for posting in the Microsoft Community.

    If I understand correctly that you have problems with Windows Update.

    Please answer these questions:

    1. What is the update's KB number?

    2 have you made any changes to the computer before the show?

    Let us try the following methods:

     

    Method 1: Run the following fix - it:

     

    The problem with Microsoft Windows Update is not working:

    http://support.Microsoft.com/mats/windows_update/

    Method 2: See the following article:

    Windows Update 80070103 error code:

    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-Update-error-80070103

    Hope the helps of information. We know if you need help. We will be happy to help you.

  • What is the problem with this URL

    Can someone tell me what is the problem with this url
    owa_util.redirect_url(apex_util.prepare_url('f?p='||:APP_ID||':25:'||:APP_SESSION||'::'||:DEBUG||':25,28'||':P25_JOBID,P25_PG:&P3_JOBID.,3, null,||:APP_SESSION'));
    It gives me a value for P25_PG, that is to say 3 but always sets P25_JOBID to 0

    Gus

    Hello Gus,

    It looks like point P3_JOBID has no value for the rendering of the page.
    If the value is set subsequently, you can try the following change

    owa_util.redirect_url(apex_util.prepare_url('f?p='||:APP_ID||':25:'||:APP_SESSION||'::'||:DEBUG||':25,28'||':P25_JOBID,P25_PG:'||:P3_JOBID||',3, null,||:APP_SESSION'));
    

    But the part at the end

    ||',3, null,||:APP_SESSION'
    

    Wil do nothing because you give only 2 items in the list separated by commas of the page elements you want to submit. Everything after the second comma in the comma separated value list is of no use for the url of the apex.

    As additional info, the URL of the Apex is built like this:
    >
    1 - application ID or alias
    2 - page ID or Alias
    3 - session & SESSION. : APP_SESSION
    4. application (for example, PRINT_REPORT = REPORT_1) & ASK. : REQUEST
    5 - debug (YES or NO) & DEBUG. : DEBUG
    6 - cache framework

    APP - clear the cache for the entire application
    SESSION - clear the current user session cache
    PR - Reset pagination
    x - clear the page cache x
    -empty the cache for the element y

    7 - separated by a comma list of items on the page
    8 - the list of values separated by commas
    9 - mode printer friendly (YES or blank)

    f? p = & APP_ID.: 1010: & APP_SESSION. : & DEBUG. : RP, 1010:P1010_ITEM1, P1010_ITEM2, P1010_ITEM3:A, B, C
    >

    Kind regards
    Kees Vlek
    -----
    Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66
    If the answer to question please change replied and mark the appropriate post as correct / helpful.

  • What is the problem with this Forum? Why Adobe taking so long to reply to messages?

    What is the problem with this Forum? Why Adobe taking so long to reply to messages?
    It is in fact 'specific' Forum of Photoshop.
    I usually come back another Adobe forum responses quickly.

    Chime.

    Hi people,

    For what it's worth, there are several of us who try, in addition to our regular work, to keep an eye on two other forums.  Quite simply, we care about the product and try to make sure that we give our customers the best experience as possible.  Plus, what better way to hear about your weak points in order to solve them.  But, as Mylenium and Christmas as well stress this, the forums are officially a user experience.  If you need help fast or official, it isn't the best place to do it.

    Regarding your question of Arab, Rahzah, I answered in two different threads and would be happy to help you with your problem.  Please choose a single thread and stick with it. two tabs is a pain.

    Thank you
    David

    PS - some of us do check the forums on our time, as I did last week at the launch while I was on vacation.

  • What is the problem with this WHERE statement?

    What is the problem with this WHERE statement?

    < cfquery datasource = "manna_premier" name = "kit_report" >
    SELECT SaleDate,
    TerritoryManager,
    Distributor,
    DealerID,
    Variable,
    US_Dealers.ID,
    DealerName,
    DealerAddress,
    DealerCity,
    DealerState,
    DealerZIPCode
    Orders, US_Dealers
    WHERE US_Dealers.ID EQ DealerID AND SaleDate BETWEEN #CreateODBCDate (FORM. Implementation) # AND #CreateODBCDate (FORM. End) #.
    ORDER BY SaleDate
    < / cfquery >

    It's driving me crazy!

    Syntax error (missing operator) in query expression ' US_Dealers.ID EQ DealerID

    You accidentally use the CF equals operator: "EQ".

    Instead of MS Access: «=»

    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver]...

    in a query expression. AND SaleDate BETWEEN #10/1/2009 #-October 18, 2009 #'.

    I don't see how CreateODBCDate() would produce these values.  But maybe it's just a quirk of the error message?

  • Could someone explain to me what is the problem with this refined expression?

    Hi, could someone explain to me what is the problem with this refined expression

    faultCode:Server.Processing faultString:' unable to invoke CFC - regular expression malformed ' ^ [0-2][0-9][/][0-1][0-2][/][1-2][0-9]{3}+$ '.»»

    Thank you

    I think that the + should not be there. Do you have a match?

  • What is the problem with this WMF?

    Hello

    The next WMF is extracted from a word document:

    x_and_f_onTopOfEachOther.wmf

    When placed in another Word file or when it is placed in an Open Office Writer document WMF seems fine, but when placed in a product Adobe (Illustrator or InDesign), the letters 'x' and 'f', and 'd' and 'x' stack up to each other.

    What is the problem and how to fix it?

    Thank you

    She helps all select and set auto kerning. Here is what happened to me

    Don't notice any specified kerning.  Now

    With Auto kerning value

  • What is the problem with this PDF?

    When I close a certain document PDF Adobe Reader (11.0.2) asks: ' do you want to save changes to... before closing?

    Apparently, something is wrong with this document, but what?

    The document is displayed correctly.

    How can I find out what's wrong with the document?

    The document can be found here.

    Horn

    question.png

    Thanks for your help guys. I found the problem. Some of the shifts in the xref table were incorrect.

    Apparently, Adobe Reader corrects the xref table. When you close the player he manages this fix as a change in the document, thus showing the dialog box "do you want to save.

  • What is the problem with this dynamic query? help

    with the following code, I get the correct answer.
    I just want to know maxempno current (and care for the 3rd, 4th tank only)

    declare
    Temp varchar2 (2);
    Start

    Select substr (A1.empno, 3, 2) in the emp A1 temp where A1.empno = (select (max (A2.empno) of emp A2) and rownum = 1;)
    HTP.p ('temp' is |) Temp)
    end;

    Temp is 34

    =====================================
    Now I need to make a call to the procedure and pass the name of a table and column

    P_CHECK_MAX
    ('emp' = > p_table,)
    ('empno' = > p_column)

    create or replace procedure 'P_CHECK_MAX '.
    (p_table in VARCHAR2,
    p_column in varchar2)

    is
    Temp varcahr2 (2);
    d_select varchar2 (500);

    Start
    d_select: ='SELECT substr (A1.'| p_column | 3: 2) IN ' | "temp" | 'FROM ' | p_table | "A1 WHERE A1.' | p_column | "= (SELECT max (A2.' | p_column |')) OF ' | p_table | ("A2) AND rownum = 1';
    immediately run d_select;

    end;

    I'm getting ORA - 00905 missing keywords. Can you help me what is the missing word here? I am stomped for hours on it.

    Published by: wanwan63 on September 29, 2009 06:23
    Sorry I reverse the setting in the call. must be p_table = > 'emp', p_column = > 'empno '.

    P_CHECK_MAX
    ("emp"-online p_table,
    'empno'-online p_column)

    It must be

    p_check_max(p_table=>'emp', p_column=> 'empno)
    

    d_select: ='SELECT substr (A1.'| p_column | 3: 2) IN ' | "temp" | 'FROM ' | p_table | "A1 WHERE A1.' | p_column | "= (SELECT max (A2.' | p_column |')) OF ' | p_table | ("A2) AND rownum = 1';
    immediately run d_select;

    IN is not part of the SQL syntax. Its syntax PL. If you can not use dynamic SQL. It should be like this

    d_select:='SELECT substr(A1.'||p_column|| ',3,2)  FROM ' || p_table || '  A1 WHERE A1.' ||p_column ||'= (SELECT max(A2.' ||p_column||') FROM ' || p_table||' A2) AND rownum=1';
    execute immediate d_select into temp;
    
  • What is the problem with this query in the source

    A blank page is region 2. Region1: enter rec_no (-rec_no is varchar2) region2:hide and show that displays one record based on rec_ no region1 entered.
    The problem is that I get the following error

    ORA-06550: line 1, column 7: PLS-00428: an INTO clause in this SELECT statement

    Here's my simple query in a process of pl/sql
    Start
    Select rec_no, rec_name from mytable where rec_no = upper(:P16_rec_no);
    end;

    Why? The same query works under the sql command.

    what I'm trying to accompolish here, it is because he has given huge if I want to display hide also multiples, regions and allow users to update each region as a result. Help, please. It kills me that I just can't understand what is causing the problem to the query. Thank you.

    Hello

    The list is set to the field EMPLOYEE_ID itself? What is the primary key of the table? In my example, DEPTNO is the primary key and I used the element generated by the wizard page to display the list. The parameters of the Source of the item itself or the column DEPTNO and database so that the process "process line...". "to identify the updated row.

    Andy

  • What is the problem with this query?

    Hello

    I need some advice on how to change the following query (with perhaps some analytical function) to speed it up. Currently, it takes 6 + minutes. This query is executed in response to a request from the front-end application and 6 + min is certainly unacceptable.

    I am trying to provide as much information I can think, but if more information is needed, please let me know.

    I have a table called "wave_result". It contains millions of rows. PK is Wave_Id, Version_nbr, node_nbr and prod_nbr. For each 'wave_id + node_NBR + prod_nbr' there are several versions (version_nbr). In the following query, I try to extract a line with MAX version_nbr for combination of ' wave_id + node_NBR + prod_nbr.

    H3. Request:
    SELECT ip1.fnln_cat,
                ip1.sub_cat,
                ip1.bus_cat,
                NVL (SUM (ip1.lsu), 0) val
        FROM ideal_prod ip1, ideal_store s, wave_result wr
       WHERE  wr.wave_id = 51
             AND wr.prod_nbr = ip1.prod_nbr
             AND wr.wave_id = ip1.wave_id
             AND wr.version_nbr =
                    (SELECT MAX (wr1.version_nbr)
                       FROM wave_result wr1
                      WHERE   wr1.wave_id = wr.wave_id
                            AND wr1.node_nbr = wr.node_nbr
                            AND wr1.prod_nbr = wr.prod_nbr)
             AND NVL (wr.ovrd_dcsn_nm, wr.dcsn_nm) = 'Add'
             AND s.wave_id = wr.wave_id
             AND s.node_nbr = wr.node_nbr 
    GROUP BY ip1.fnln_cat, ip1.sub_cat, ip1.bus_cat
    H3. Rank of charges:
    ========
    "wave_result" is the largest table with millions of rows.
    Table                Total Rows       Rows for wave_id = 51
    Ideal_prod           188K             38K
    Ideal_store          3K               574
    Wave_result          90M              19M
    H3. Stats
    are updated almost daily by the DBA (not sure if that's a good or bad).

    H3. Explain the Plan:
    =========
    SELECT STATEMENT ALL_ROWS Cost: 330,737 Bytes: 401,787 Cardinality: 14,881 
         12 HASH GROUP BY Cost: 330,737 Bytes: 401,787 Cardinality: 14,881 
              11 VIEW VIEW SYS.VM_NWVW_2 Cost: 330,737 Bytes: 401,787 Cardinality: 14,881 
                   10 FILTER 
                        9 HASH GROUP BY Cost: 330,737 Bytes: 2,425,603 Cardinality: 14,881 
                             8 HASH JOIN Cost: 327,183 Bytes: 41,233,784 Cardinality: 252,968 
                                  1 INDEX RANGE SCAN INDEX (UNIQUE) APAPOPR.XPKIDEAL_STORE Cost: 4 Bytes: 13,202 Cardinality: 574 
                                  7 HASH JOIN Cost: 327,178 Bytes: 35,415,520 Cardinality: 252,968 
                                       5 HASH JOIN Cost: 198,619 Bytes: 18,764,328 Cardinality: 183,964 
                                            3 TABLE ACCESS BY INDEX ROWID TABLE APAPOPR.IDEAL_PROD Cost: 939 Bytes: 2,272,380 Cardinality: 37,873 
                                            4 TABLE ACCESS FULL TABLE APAPOPR.WAVE_RESULT Cost: 197,063 Bytes: 7,974,414 Cardinality: 189,867 
                                       6 INDEX RANGE SCAN INDEX (UNIQUE) APAPOPR.XPKWAVE_RESULT Cost: 82,467 Bytes: 721,495,854 Cardinality: 18,986,733 
    H3. Sample data:
    ===========
       For wave_id = 51
                     there are 28466854 rows in "wave_result" table
    
       For wave_id = 51 and node_nbr = '0201' and  prod_nbr = '0226960'
                     there are 3 rows in "wave_result" table
    H3. Version of database information are below to:
    =========================
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE            11.1.0.7.0                        Production
    TNS for IBM/AIX RISC System/6000: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Thank you very much!!

    Concerning
    For wave_id = 51
                     there are 28466854 rows in "wave_result" table
    
       For wave_id = 51 and node_nbr = '0201' and  prod_nbr = '0226960'
                     there are 3 rows in "wave_result" table
    

    As you mentioned that this particular request is called by a front screen, how different search criteria you get it to show on the front end?
    Assuming that if the user is searching just of wave_id = 51 which lines returns to 28466854, it is certainly not a good approach to go look up many records to put end Front end is very light and can not hold many records and will be finally the web server will throw off out of memory exception. Always a limit on the number of records that you retrieve from the database and display it on the front plane.
    OR
    The second case where the user makes a search by wave_id, node_nbr and prod_nbr, even if she returns to 3 lines, behind the scens, he still made a full scan on the wave_result table. If we go with analytical function, we can reduce a sweep of extra table on the wave_result table. Also the table has millions of lines and the max (version_nbr) seems to be a frequently used on this table sub query. While inserting a record into the table wave_result, you must probably have a calculated value that will tell you its value max and you will choose just the rank of this value, instead of at each time max(). something like below...

    SELECT ip1.fnln_cat,
                ip1.sub_cat,
                ip1.bus_cat,
                NVL (SUM (ip1.lsu), 0) val
        FROM ideal_prod ip1, ideal_store s, wave_result wr
       WHERE ipl.wave_id = 51
             AND wr.prod_nbr = ip1.prod_nbr
             AND wr.wave_id = ip1.wave_id
             AND wr.wave_id = s.wave_id
             AND wr.node_nbr = s.node_nbr
             AND wr.precomputed_max_value = 'MAX'
             AND NVL (wr.ovrd_dcsn_nm, wr.dcsn_nm) = 'Add'
    GROUP BY ip1.fnln_cat, ip1.sub_cat, ip1.bus_cat;
    
  • What is the problem with this page and IE?

    Gents,

    I have this page, exported from Excel to a HTML file, added some jQuery and Spry ToolTips and published it.

    It works very well with Firefox and Chrome, but IE trips on it. It simply display a blank page.

    Here is the link to the home page: Référence PPBM5

    With FF or Chrome test results page appears without a problem with IE, it's just a blank page. It's the page that causes these problems: http://ppbm5.com/Benchmark5.html

    Who am I to spoil that IE does not work? Any suggestion is welcome.

    Ready for the same problem of crazy...

    You have

    Benchmark results<p class="reply"> <p class="reply">When I changed it to</p> <p class="reply"><title>Benchmark results

    It worked.

    Gary

  • Create tables custom wwww in schema Apps (what are the problems with this?)

    Hi all

    I'm a dba in a new environment where a number of custom diagrams is created in the schema of apps. I know that this is not considered the best practices of Oracle and I would like to make some recommendations for a change. Before that, I would like to know the problems that are associated with custom tables, living in the apps schema. We're currently on 11.5.10.2 on AIX. Also, if anyone can point me to the 'Official' standard customization or Oracle documentation where can I back up my case it would be greatly appreciated.

    Thanks in advance,

    Hello

    Please see this thread.

    Custom application implemented in E-bussiness Suite
    Re: Custom application is implemented in E-bussiness Suite

    Kind regards
    Hussein

Maybe you are looking for