Recursion cursor

I have two tables
course (cname,courno) and prerequsite(courseno,prerequisite)
prerequsite is foreign key on course
on pl/sql
a course will be input and all prerequsite course and prerequsite of prerequsite course will be fetch into a table
so how can i write this code
I tried to use cursor but one cursor is not necessary, is there a recursion cursor
I mean u can get one prerequisite but u can not get prerequisite of prerequisite in that cursor
Thnaks in advance

You need an hierarchical query here on the prerequisites table to give you the list. If you want course names for all the prerequisites, then you will need to also join to courses a seconf time as im my example.
SQL> SELECT * FROM courses
  2  /
  COURSENO CNAME
       301 MEDIUM MATH
       201 EASIER MATH
       101 BASIC MATH
       305 MULTIPLICATION
       205 SUBTRACTION
       105 ADDITION
       402 HARDER MATH
       401 HARD MATH
       406 HARD ENGLISH
SQL> SELECT * FROM prerequisite
  2  /
  COURSENO PREREQUISITE
       401          301
       301          201
       201          101
       401          305
       305          205
       205          105
       402          301
       402          306
SQL> SELECT a.courseno course, a.cname course_name,b.prerequisite,
  2         c.cname prerequisite_name
  3  FROM courses a,
  4       (SELECT courseno,prerequisite
  5        FROM prerequisite
  6        START WITH courseno = 401
  7        CONNECT BY PRIOR prerequisite = courseno) b,
  8        courses c
  9  WHERE a.courseno = b.courseno and
10        b.prerequisite = c.courseno
11  /
    COURSE COURSE_NAME          PREREQUISITE PREREQUISITE_NAME
       201 EASIER MATH                   101 BASIC MATH
       205 SUBTRACTION                   105 ADDITION
       301 MEDIUM MATH                   201 EASIER MATH
       305 MULTIPLICATION                205 SUBTRACTION
       401 HARD MATH                     301 MEDIUM MATH
       401 HARD MATH                     305 MULTIPLICATIONJohn

Similar Messages

  • ORA-04030: out of process memory opening a cursor

    Hi,
    We are wonking on Oracle 9i dedicated server OLTP.
    When a Pro*C process tries to open a big query cursor the ORA-04030 is returned by Oracle. Below is the query plan:
    | Id  | Operation                 |  Name           | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT          |                 |    41 |  4182 |  1038K|
    |   1 |  SORT UNIQUE              |                 |    41 |  4182 |  1038K|
    |   2 |   HASH JOIN               |                 |    41 |  4182 |  1038K|
    |   3 |    VIEW                   |                 |   157K|  8002K|   164K|
    |   4 |     SORT UNIQUE           |                 |   157K|    11M|   162K|
    |   5 |      HASH JOIN            |                 |   157K|    11M|   160K|
    |   6 |       VIEW                |                 |  3151K|   126M| 51970 |
    |   7 |        SORT ORDER BY      |                 |  3151K|   117M| 51970 |
    |   8 |         TABLE ACCESS FULL | RE_ASNEF        |  3151K|   117M| 17637 |
    |   9 |       VIEW                |                 |  6427K|   208M| 89856 |
    |  10 |        SORT ORDER BY      |                 |  6427K|   214M| 89856 |
    |  11 |         HASH JOIN         |                 |  6427K|   214M| 25130 |
    |  12 |          TABLE ACCESS FULL| TIPO_CLIENTE    |    21 |   357 |     2 |
    |  13 |          TABLE ACCESS FULL| LISTA_CLIENTES  |    11M|   204M| 25084 |
    |  14 |    VIEW                   |                 |    12M|   599M|   861K|
    |  15 |     SORT ORDER BY         |                 |    12M|   695M|   861K|
    |  16 |      TABLE ACCESS FULL    | RECIBOS         |    12M|   695M|   670K|
    -----------------------------------------------------------------------------We guess that the problem is that the dedicated server process is triying to allocate more memory that allowed by OS per process:
    cobros1p:$ ulimit -a
    time(seconds)        unlimited
    file(blocks)         unlimited
    data(kbytes)         131072
    stack(kbytes)        32768
    memory(kbytes)       32768       <<<-----
    coredump(blocks)     2097151
    nofiles(descriptors) 2000OS memory limit can´t be increased, so we guess that one posible solution is to split the query using temporary tables to reduce "hash join/sort" PGA space.
    Are we right? Any hint about other possible solutions?
    Thanks in advance,
    Jose Luis

    From various notes you can find on MOS about 4030:
    "Each Operating System will handle memory allocations with Oracle slightly differently."
    "The application developer of an Oracle precompiler program or OCI program can explicitly open cursors, or handles to specific private SQL areas, and use them as a named resource throughout the execution of the program. Recursive cursors that Oracle issues implicitly for some SQL statements also use shared SQL areas.
    The management of private SQL areas is the responsibility of the user process. The allocation and deallocation of private SQL areas depends largely on which application tool you are using, although the number of private SQL areas that a user process can allocate is always limited by the initialization parameter OPEN_CURSORS. The default value of this parameter is 50.
    A private SQL area continues to exist until the corresponding cursor is closed or the statement handle is freed. Although Oracle frees the runtime area after the statement completes, the persistent area remains waiting. Application developers close all open cursors that will not be used again to free the persistent area and to minimize the amount of memory required for users of the application. "
    "However, from within the database framework you cannot place a hard limit on the size of a process by setting any initialization parameters or database configuration.
    You can limit the size of a process from the OS side by setting kernel limits or user shell limits.
    However, this leads to the ORA-4030 and will cause transaction rollback."
    You need to have some serious discussions with both your app developers and your OS admins, though if you are running something from the last century, that could be pointless.

  • Error while renaming indexes and keys in the tables

    hi gems...good afternoon..
    i am using oracle 11gr2 database.
    when i am trying to rename the primary key, foreign key, indexes of all the tables as per the standard, then the following error is given...
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    ORA-01000: maximum open cursors exceeded
    currently the maximum open cursors parameter is set to 300.
    please help..thanks in advance

    thanks a lot for your help..
    there are total 162 records in the v$open_cursor for that user.
    among that the open cursor is only 4 and open-recursive cursor is only 6 for that user.
    in my session i am executing only the renaming of the constraints and nothing more.
    When i have queried the v$open_cursor for cursor_type='OPEN' for all the users, then i got that it has exceeded the value of open_cursors parameter.
    So how can i resolve that....

  • Help Page Error: Using XPath expressions as list indexes and map keys

    The help page says for maps to use the XPath expression
    /process_data/mapvar[@id='/process_data/@stringvar']
    But in reality for things to work you have to omit the quotations.

    thanks a lot for your help..
    there are total 162 records in the v$open_cursor for that user.
    among that the open cursor is only 4 and open-recursive cursor is only 6 for that user.
    in my session i am executing only the renaming of the constraints and nothing more.
    When i have queried the v$open_cursor for cursor_type='OPEN' for all the users, then i got that it has exceeded the value of open_cursors parameter.
    So how can i resolve that....

  • MaxDB 7.6 carshes on calling stored procedure with driver 7.6

    Hi All,
    Recently I upgraded MaxDB from v7.5 to v7.6 after several hiccups I am almost done but one strange problem remains. I have a stored procedure which is used for generating Bill Of Material (recursive cursor). The said stored procedure uses some views (if that matters at all). If I call that stored procedure using JDBC driver v7.5 then all works well and if JDBC driver v7.6 is used to call the stored procedure it simply crashes the database. Does not it sound strange
    Does anyone have any clues?
    Thanks,
    Vinod

    Hi Marco,
    Here is the stored procedure, which causes database crash-
    START -
    [code]CREATE DBPROC shortlist_all_month (IN schedule VARCHAR(14)) RETURNS CURSOR AS
        $CURSOR = 'bom';
        BEGIN
        CREATE TABLE temp.bom_view
          (bom_version, main_item_code, sub_item_code, sub_item_qty, bom_item_remarks) AS
          SELECT bom_version, main_item_code, sub_item_code, sub_item_qty, bom_item_remarks
          FROM suman.mfg_bom_m
          WHERE bom_version = (SELECT MAX(bom_version) FROM suman.mfg_bom_m M
                        WHERE M.main_item_code = mfg_bom_m.main_item_code);
        DECLARE :$CURSOR CURSOR FOR
        WITH RECURSIVE PX (main, sub, qty, super_main) AS
           (SELECT main_item_code, sub_item_code, sub_item_qty, main_item_code
             FROM temp.bom_view WHERE main_item_code IN (
                SELECT schedule_plan_item FROM suman.ppc_schedule_m WHERE schedule_code = :schedule)
            UNION ALL
            SELECT main_item_code, sub_item_code, sub_item_qty, super_main
             FROM temp.bom_view B, suman.PX
             WHERE sub = B.main_item_code)
        SELECT sub AS sub_item_code, item_item_desc, item_mfg_flag, stock_item_qty,
         SUM(qty * schedule_plan_qty) AS req_qty, (stock_item_qty - SUM(qty * schedule_plan_qty)) AS short_qty
         FROM suman.PX B, suman.ppc_schedule_m S, suman.mfg_item_p I, suman.mfg_item_stock V
         WHERE B.super_main = S.schedule_plan_item
         AND schedule_code = :schedule
         AND B.sub = I.item_item_code
         AND B.sub = V.stock_item_code
         AND V.stock_dept_code = 'DP0008'
         GROUP BY sub, item_item_desc, item_mfg_flag, stock_item_qty
         HAVING SUM(qty * schedule_plan_qty) > 0 ORDER BY 3, 1;
        DROP TABLE TEMP.BOM_VIEW;
    END;[/code]----
    END -
    This used to work fine for last >4 years. See if you can find something fishy. I will try to give a runnable test case to reproduce the crash.
    Thanks,
    Vinod

  • General SQL

    Is there anything called recursive query in Oracle. If yes please give one example how to use this.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by kvprabhu:
    Is there anything called recursive cursor in Oracle. If yes please give one example how to use this.<HR></BLOCKQUOTE>
    null

  • Recursion with reference cursors

    Hi,
    I need to do a recursive SQL select in a report. Using reference
    cursors I can do dynamic SQL selects. What do I need to do if I
    must do this recursively. I run into cursor already open error
    trying to close the cursor does not help as well.
    Any ideas?
    TIA
    Srinivas

    Ok, so you know how the if- test works, and you even seem to almost understand the code you have posted (presuming your professor has written the code, right?). Good start! I like the way you post the code and ask the question can it be done? It is far better than just writing please do my homework for me, because I am too lazy to do it myself...
    Have a look in your programming book and reed the chapter about loops. It should give you an idea of how to solve your assignment.
    And try posting to the right forum. This question belongs to the New To Java Technology forum. Later on you may advance to the Java Programming forum.
    Good luck!

  • How can I implement a recursive update within triggers?

    Given
    INSTANCE (table)
    INST_ID
    etc.
    INSTANCE_STRUCTURE (table)
    PARENT_ID (fk to INST_ID)
    CHILD_ID (fk to INST_ID)
    And that I COULD write code which recursively navigates the hierarchy (ie. START WITH parent_id = ? CONNECT BY PRIOR child_id = parent_id) and issues UPDATEs to each "child" along the way, thereby propogating the desired update, how can I accomplish the same thing using triggers?
    Keep in mind I am using Oracle 7.3 and I have no choice. Also, the DBA is very difficult to get a hold of and I have no idea if there may be some server settings which are preventing some of my attempts from succeeding.
    Of course the simplest method is to make an update trigger on INSTANCE select all CHILD_ID from INSTANCE_STRUCTURE and issue UPDATE to each which, in turn, would invoke the same trigger, however, we can't have a mutating table, now can we?
    Next, I tried the old global variable in a package bit. That's when I first started getting this "end of channel" business which essentially disconnects me from Oracle (while using SQLPlus). I started to debug that, and then other users started getting errors ... apparently due to the global variable being global ACROSS sessions ... which I did not expect (correct me if I'm wrong and I can try it again), however, due to the amount of data I'm dealing with in any one particular line of hierarchy, I'm not sure I wouldn't get an error anyhow ... particularly if I have to maintain a global array for everyone at once. Anyhow, it was during that, that I realized the "too many open cursors" thing and so I started working with START WITH CONNECT BY to identify all rows which must be dealt with.
    Then, I tried setting up some new tables (as opposed to global variables) in which I would identify userenv('sessionid') and other data so that a BEFORE UPDATE, FOR EACH ROW trigger could check to make sure that the AFTER UPDATE trigger had not begun yet (IOW, not recursing yet). Basically, everything's fine until the AFTER UPDATE trigger tries to apply UPDATEs for the children (identified from a cursor on START WITH CONNECT BY) ... then I get the "end of channel" thing again.
    Obviously, this whole thing is an attempt to denormalize some data for performance reasons.
    Any help would be appreciated.
    Thanks.

    Nevermind, I figured somethin' out.

  • Maximum open cursors

    Hi,
    I have an application running on NT station versus Oracle 8.0.5 database on NT server.
    I'm getting the ORA-01000 error while running a report. This error doesn't appear regulary while running the concerned report. it appears after calling the report several times (closing then opening).
    After the error appear everytime I call the report this error appear until the user restart the PC. I did check the report and I'm closing the cursors I opened.
    I had the open_cursors parameter in the INIT file set for 400 then I changed to 600 but this didn't change a thing (I restarted my database).
    I'm using recursive functions but I'm always closing the cursors before calling the function recursively.
    And I also want to notes that the recursive function depending on the data I have won't go more than 2 or 3 levels deeper.
    Please confirm it is bug 492362: NT/95/3.1.1 - REPORTS DOES NOT RELEASE OPENED CURSORS. and how to fix it.
    THANKS

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ali DHAINI ([email protected]):
    Hi,
    I have an application running on NT station versus Oracle 8.0.5 database on NT server.
    I'm getting the ORA-01000 error while running a report. This error doesn't appear regulary while running the concerned report. it appears after calling the report several times (closing then opening).
    After the error appear everytime I call the report this error appear until the user restart the PC. I did check the report and I'm closing the cursors I opened.
    I had the open_cursors parameter in the INIT file set for 400 then I changed to 600 but this didn't change a thing (I restarted my database).
    I'm using recursive functions but I'm always closing the cursors before calling the function recursively.
    And I also want to notes that the recursive function depending on the data I have won't go more than 2 or 3 levels deeper.
    Please confirm it is bug 492362: NT/95/3.1.1 - REPORTS DOES NOT RELEASE OPENED CURSORS. and how to fix it.
    THANKS<HR></BLOCKQUOTE>
    Hi, i have the same problem. Have you solve this problem? Can you tell me how to fix it?
    Thank yoy
    null

  • Amount of open cursor problem

    I am trying to display a tree-like data with a varchar2 field called ancestor indicating its family nodes, e.g. 1:2:5:16. A quick solution would be recurssion:
    procedure data_list(id in number default null) as
    cursor c1 is select * from table1 where ancestor is null;
    cursor c2 is select * from table2 where get_parent(ancestor) = id;
    -- get_parent(varchar2) is a function return parent id of current data.
    if (id is null) then
    -- display root nodes
    -- open c1 and print out data
    -- then recursively call itself to print out its children
    data_list(id);
    close c1;
    else
    -- open c2 and print out data
    -- then recursively call itself to print out its childen
    data_list(id);
    close c2;
    end if;
    end data_list;
    ======================
    As you notice, the problem is that if the tree is too high (or too deep) the amount of cursors being open simultanously might be huge, which will definitely degrade the performance of the server, especially under multiuser environment.
    Does someone here have better solution for this problem?
    Thanks.

    You probably want to start by looking into Oracle's hierarchal query support with the CONNECT BY clause and the SYS_CONNECT_BY_PATH function. Grabbing a quick example from the Oracle SQL Reference http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions121a.htm#1038139
    SELECT LPAD(' ', 2*level-1)||SYS_CONNECT_BY_PATH(last_name, '/') "Path"
       FROM employees
       START WITH last_name = 'Kochhar'
       CONNECT BY PRIOR employee_id = manager_id;
    Path
    /Kochhar
       /Kochhar/Greenberg
         /Kochhar/Greenberg/Faviet
         /Kochhar/Greenberg/Chen
         /Kochhar/Greenberg/Sciarra
         /Kochhar/Greenberg/Urman
         /Kochhar/Greenberg/Popp
       /Kochhar/Whalen
       /Kochhar/Mavris
       /Kochhar/Baer
       /Kochhar/Higgins
         /Kochhar/Higgins/GietzNote that hierarchal queries work very well when you have tree data. If you actually have a graph, it starts to get more complicated.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • ORA-00604: error occurred at recursive SQL level 1 (Call to a Oracle View)

    I have created a view that refers to a package function within the sql select.
    Like
    E.x
    CREATE OR REPLACE VIEW VW_TAX
    as select
    test_pkg.fn_get_gl_value(acct_id) desired_col1,
    test_pkg.fn_get_gl_desc_value(acct_id) desired_col2
    From tables a, b
    a.col= b.col
    The sample function( fn_get_gl_value) is embedded into a package (test_pkg).
    Function fn_get_gl_value:
    It earlier referred to table A1, B1, C1 and this query took really long, Therefore I used object type tables and stored the values required once within the package when it is invoked. Later I used the Tables A1, B1 and C1(table Cast from the type Table Loaded in Package Memory)
    The query was fast and fine, but now when I try to re-use the view
    select * from VW_TAX
    where acct_id = '02846'
    It fails with this message
    09:32:35 Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-01000: maximum open cursors exceeded
    Note: The database is Oracle8i Enterprise Edition Release 8.1.7.4.0.
    Maximum cursors database is 500
    Please let me know if there is any known solution,
    Appreciate all your help
    Thanks
    RP

    Seems like your OPEN_CURSORS init.ora parameter is set too low.
    See Metalink Note:1012266.6 for details.
       ORA-01000: "maximum open cursors exceeded"
            Cause: A host language program attempted to open too many cursors.
                   The initialization parameter OPEN_CURSORS determines the
                   maximum number of cursors per user.
           Action: Modify the program to use fewer cursors. If this error occurs
                   often, shut down Oracle, increase the value of OPEN_CURSORS,
                   and then restart Oracle.

  • ORA-00604: error occurred at recursive SQL level

    I only have 2 users and approx 9 schemas.
    Why is this complaining about maximum cursors??
    Error message:
    ORA-00604: error occurred at recursive SQL level
    ORA-01000: maximum open cursors exceeded
    ORA-0064 error occurred at recursive SQL level
    Cause:
    An error occurred at recursive SQl level
    (a statement applying to internal dictionary tables)
    >>
    Created 2 users
    1) boundaries (User)
    has a couple of schema.
    National, provincial, district, village
    I have set-up the Primary & Foreign keys.
    Only 1 table has 1 row of data
    2) Projects (User)
    Set up one table - Program
    Program has a Primary Key.
    Foreign key is linked to (boundaries) national PK
    The problem occured when I entered data into boundaries.national

    Clive_S wrote:
    OS: Windows Server 2008 standard - 64 bit.
    Select * from v$version
    Oracle Database 11g release 11.1.0.7.0 - 64 bit
    PL/SQL release 11.1.0.7.0 - production core 11.1.0.7.0
    Production TNS for 64-bit windows: 11.1.0.7.0
    Production NLSRTL for 64-bit windows: 11.1.0.7.0
    I am trying to replicate in Oracle what I would do in SQL Server. There's your first mistake. There are too many differences. My first programming language was COBOL, but I don't write other languages as if they were COBOL.
    I cannot attach an image of the users & tablespace, to illustrate.Another reason to work in sqlplus.
    >
    I created 2 User = Boundaries and Project
    I created several schemas (tables)No, you created 2 schemas. One user = one schema = one user.
    A schema is not a table and a table is not a schema. A schema is a collection of objects, which can include multiple tables but only those owned by one username.
    >
    Boundaries (user)
    Tables:
    Country
    Province
    District
    Village
    Projects (user)
    Tables:
    Program
    Project.Program has a FK = Country that is linked to Boundaries.Country
    I need to create several scemas (databases):Another difference. a schema is not a database, though the sql server concept of a database is somewhat analogous to an oracle schema.
    Boundaries, Project, Assets.
    There are foreign keys linking the various schemas.FKs link tables not schemas.
    Edited by: EdStevens on Feb 26, 2010 10:30 AM

  • ORA-00604:error occurred at recursive SQL level1 ORA-01000:maximum open cur

    Dear Experts,
    I got Error During WebLoad Testing.
    Please give me solution.
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-01000: maximum open cursors exceeded

    It depends on how may cursors are used in your program and the parameter value for OPEN_CURSORS. If it is not possible to reduce the number cursors used in the program increase the OPEN_CURSORS value.
    regards

  • ORA-00604: error occurred at recursive SQL when calling proc via db_link

    Hi,
    I'm on 9.2.0.8 and got strange issue with simple test case
    on source db:
    CREATE OR REPLACE PROCEDURE ADMIN.gg_ref(out_tokens OUT SYS_REFCURSOR) is
      BEGIN
      OPEN out_tokens for select dummy from dual;
    END ;
    Now testing code localy:
    SQL> var r refcursor
    SQL> declare
      2   output sys_refcursor;
      3  begin
      4   adminx.gg_ref(output);
      5  :r:=output;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print r
    D
    X
    So its working.
    I've got db_link to that db , and now call that proc via dblink from other 9.2.0.8 DB:
    var r refcursor
      1  declare
      2   output sys_refcursor;
      3  begin
      4   admin.gg_ref@LINK_NAME(output);
      5  :r:=output;
      6* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00900: invalid SQL statementWhats wrong with my code ?
    Are there any restriction I'm not aware of ?
    Regards
    GregG

    GregG wrote:
    What should my code look like now ?
    Should I rewrite this as function returning index by collection or something ?You can use DBMS_SQL - but use the remote package and not the local one. This is a little bit more complex ito call interface than using a ref cursor, but is the very same thing on the server side. DBMS_SQL also provides a more comprehensive set of features than using the ref cursor interface.
    The main issue though is additional coding - as DBMS_SQL is a lower level interface (a lot closer to the real Oracle Call Interface/OCI):
    --// on remote database the procedure returns a DBMS_SQL cursor instead of a ref cursor
    SQL> create or replace procedure FooProc( cur in out number, deptID number ) is
      2          rc      number;
      3  begin
      4          cur := DBMS_SQL.open_cursor;
      5 
      6          DBMS_SQL.parse(
      7                  cur,
      8                  'select ename from emp where deptno = :deptID',
      9                  DBMS_SQL.native
    10          );
    11 
    12          DBMS_SQL.Bind_Variable( cur, 'deptID', deptID );
    13 
    14          rc := DBMS_SQL.Execute( cur );
    15  end;
    16  /
    Procedure created.
    --// from the local database side we call this remote proc
    SQL> declare
      2          c               number;  --// instead of using sys_refcursor
      3          empName         varchar2(10); --// buffer to fetch column into
      4  begin
      5          FooProc@testdb( c, 10 );  --/ call the proc that creates the cursor
      6 
      7          --// we need to define our fetch buffer for the 1st column in the
      8          --// SQL projection of that cursor (10 byte fetch buffer for 1st column)
      9          DBMS_SQL.define_column@testdb( c, 1, empName, 10 );
    10 
    11          --// we now fetch from this cursor, but via the DBMS_SQL
    12          --// interface
    13          loop
    14                  --// fetch the row (exit when 0 rows are fetched)
    15                  exit when DBMS_SQL.Fetch_Rows@testdb( c ) = 0;
    16 
    17                  --// copy value of 1st column in row into the local PL/SQL buffer
    18                  DBMS_SQL.column_value@testdb( c, 1, empName );
    19 
    20                  --// record value it via dbms output
    21                  DBMS_OUTPUT.put_line( 'name='||empName||' deptID=10' );
    22          end loop;
    23 
    24          --// close it explicitly as you would a ref cursor
    25          DBMS_SQL.Close_Cursor@testdb( c );
    26  end;
    27  /
    name=CLARK deptID=10
    name=KING deptID=10
    name=MILLER deptID=10
    PL/SQL procedure successfully completed.
    SQL>

  • ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement

    Hi ,
    we pass Query to ref cursor using with clause and it works fine on oracle Sql but raise an error when called from
    ADO.net
    for example
    create or replace package body abc_details
    as
    proedure initial (p_refcursor out sys_refcursor)
    is
    begin
    v_sql='with a as (select ..
    , b as (select * from table(emppkg.empdetails))
    open p_refcursor for v_sql;
    end;
    with oracle 10g it works fine on Sql prompt and fetches the results but when called from ado.net it
    intermitantly fetches and error "ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement "
    Please suggest
    Thanks in advance.

    wild guess here,
    but emppkg.empdetails type look's like a pl/sql type,
    while it should be a sql type.
    Amiel

Maybe you are looking for