REF CURSOR Vs objects

Hi all

I'm working on Oracle 10 g. e could migrate to 11g in the coming months, our front end is with .net.

I have a few scenarios where I pass the end before a set of values... (sometimes a few 100 and sometimes some 1000s)

On what basis should I decide to go with the REF cursor or with objects...

Is there a particular scenario where I can adapt REF CURSOR Type and objects...


Appreciate your help and your sugessions

Thanks in advance
M

Mandatory AskTom references:

The use of collections of Oracle and result sets
PL/SQL API for Java/VB - tables to return data or result sets

Tags: Database

Similar Questions

  • View BC item from the ref cursor oracle

    Is there an easy way to jdev 11.1.1.4 to create a view based on a ref cursor oracle object?

    It's in the docs http://docs.oracle.com/cd/E21043_01/web.1111/b31974/bcadvvo.htm#sm0341 search for 'How to create a display on a REF CURSOR object'
    An example can be found here http://adfpractice-fedor.blogspot.de/2011/01/adf-bc-programmatically-populated-vo.html

    Timo

  • View object Ref Cursor

    Hello

    I use ADF 11 g business components.

    I have a function that returns a type weak ref cursor. Number of columns is not known until the function is executed. Is there a way to create a display programmatically on this Ref Cursor object?

    Published by: Deniz Gulmez on 10.Oca.2010 23:40

    You can try with

    public AttributeDef addDynamicAttribute(java.lang.String attrName)
    // or
    public AttributeDef addDynamicAttributeWithType(java.lang.String attrName,
                                                    java.lang.String javaTypeName,
                                                    java.lang.String transientExpression)
    

    Timo

  • Apex and accept Ref Cursor?

    Apex and accept Ref Cursor?

    Apex and accept objects?

    can someone help me please.

    Hi Nani4850,

    Nani4850 wrote:

    Apex and accept Ref Cursor?

    Apex and accept objects?

    The language of business for APEX is PL/SQL, so yes you can use REF CURSOR and pass objects to you packaged functions/procedures.

    How does this relate to Oracle APEX?

    Please explain what you plan to use a REF CURSOR in the APEX.

    Kind regards

    Kiran

  • Report regions - use of the Ref Cursor?

    APEX 4.2

    See http://mikesmithers.wordpress.com/2012/02/22/getting-apex-to-play-with-ref-cursors

    The above article is older than 2 years. The techniques shown in the link above still valid today if we want to create a report region in the APEX are based on a function that returns a Ref Cursor? Are there improvements in this area for the next APEX 5.0 and/or database Oracle 12 c?

    Thank you

    HELEN wrote:

    APEX 4.2

    See http://mikesmithers.wordpress.com/2012/02/22/getting-apex-to-play-with-ref-cursors

    The above article is older than 2 years. The techniques shown in the link above still valid today if we want to create a report region in the APEX are based on a function that returns a Ref Cursor?

    If the function returns the ref cursor is the only point of access that you have data then Yes, it probably is. If you have direct access to the underlying database objects and the function does not have something very complicated, then you are probably better off creating your own body of the function returning SQL query data source.

    Everything about the dynamics of ref Cursor now I divided in 2 layers, with a function for generating the dynamic SQL and another for bind parameters open the ref cursor. APEX apps can then reuse the functions of SQL query in function body return SQL query data sources (if you take a bit of care to keep the bind variable names vaguely APEX-point-friendly).

    Are there improvements in this area for the next APEX 5.0 and/or database Oracle 12 c?

    See this for the technical background on why APEX is not yet support ref Cursor and this for more information of the Oracle team on the possibility of future support. Obviously, he did not he in 4.1. I suspect that data REF CURSOR region sources depended on a minimum requirement of DB of the 11.1.0.6 (where was introduced support for the conversion of the REF CURSOR in the cursors DBMS_SQL). As minimum DB for APEX 5.0 version is 11.1.0.7, it would be a possible feature for 5.0, but it is not classified as one.

  • REF CURSOR ERROR

    I get the following error when you try to select using a ref cursor

    SQL error: ORA-06504: PL/SQL: return variables of the game results or the query types do not match

    Here are the steps that I have followeed. Can someone tell me what I did wrong.

    -CREATE AN OBJECT

    create or replace type rsn_rec as object
      (
     rsn_cd   varchar2(10),
     rsn_desc  varchar2(30)
    );
    

    -CREATES A TABLE OF OBJECT

    create or replace type rsn_tbl as table of rsn_rec;
    

    PACKAGE/CREATED FUNCTION

    create or replace package pkg_rept_test as
      type refcur is ref cursor;
      function get_rsn return rsn_tbl pipelined;
    end pkg_rept_test;
    create or replace package body pkg_rept_test as
      function get_rsn
        return rsn_tbl pipelined is
          o_cursor refcur;
          rec rsn%ROWTYPE;
        begin
          open o_cursor for 
           select 
            rsn_cd,         
            rsn_desc       
           from rsn;
          loop
            fetch o_cursor into rec;
            exit when (o_cursor%notfound);
            pipe row(rsn_rec(rec.rsn_cd,                                                                                                   rec.rsn_desc)
                             );
          end loop;
          return;
      end;
    end pkg_rept_test;
    

    -THE TABLE SELECTION

    select * from table(pkg_rept_test.get_rsn)
    

    -ERROR
    SQL error: ORA-06504: PL/SQL: return variables of the game results or the query types do not match

    Your code works for me just as you posted.

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > create table rsn (rsn_cd varchar2 (10), rsn_desc varchar2 (30));

    Table created.

    SQL > insert into rsn values ("cd test", "test description");

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > create or replace the rsn_rec as an object type

    2        (

    3 rsn_cd varchar2 (10),

    rsn_desc 4 varchar2 (30)

    5      );

    6.

    Type of creation.

    SQL > create or replace type rsn_tbl in the rsn_rec table;

    2.

    Type of creation.

    SQL > create or replace package pkg_rept_test as

    2 type refcur is ref cursor;

    3 function get_rsn return rsn_tbl in pipeline;

    4 end pkg_rept_test;

    5.

    Package created.

    SQL > create or replace package body pkg_rept_test as

    2 function get_rsn

    3 return rsn_tbl pipeline is

    4 o_cursor refcur.

    5 rec rsn % ROWTYPE;

    6 start

    7. open o_cursor for

    8. Select

    rsn_cd 9,.

    10 rsn_desc

    11 of rsn;

    12 loop

    13 extract o_cursor in rec;

    When exit 14 (o_cursor % notfound);

    line 15 pipe (rsn_rec (rec.rsn_cd, rec.rsn_desc)

    16                               );

    17 end of loop;

    18 return;

    end 19;

    20 end pkg_rept_test;

    21.

    Package body created.

    SQL > select * from table (pkg_rept_test.get_rsn);

    RSN_CD RSN_DESC

    ---------- ------------------------------

    tests of cd test description

  • How to start the view off of the ref cursor Oracle as input/output param

    Hello world

    We use JDev 11.1.2.3 WL 10.3.6 and Java 7.

    We are at the beginning of our transition from Oracle Forms to ADF.  We have a very large forms that uses many store procedures that have IN/OUT ref Cursor parameters and tables plsql.  I tried to find information on best practices to achieve, but only seemed to find tutorials on SEO of the Oracle ref Cursor return functions.  I hope we don't have to rewrite our code of database to work with ADF.

    This is an example of a proc currently a block on a form based on directly

    The ref cursor parameter is input/output to satisfy the way the form handles this type of paradigm.

    ADF we want I hope to reuse these procs existing (without the need to wrap/overload them) on the basis of the display objects.

    Example:

    / * my record type which houses the information I want to go back * /.

    TYPE rec_hist_vacpac_status IS RECORD)

    rec_order NUMBER (5),

    rec_rownum NUMBER (5),

    return_column SAM_VACPAC.vacpac_status%TYPE,

    rec_login_id SAM_VACPAC.ins_user%TYPE,

    status_date SAM_VACPAC.status_date%TYPE

    );

    / * Sets the ref cursor type * /.

    TYPE lcur_hist_vacpac_status IS REF CURSOR;

    / * This is a procedure that would take some info link go / return

    Return the ref cursor of this information as an in / out * /.

    PROCEDURE prc_myinfo_refcur)

    pnum_identify_seq_id in NUMBERS

    pcur_myinfo IN OUT lcur_hist_vacpac_status);

    Can anyone point me in the right direction on documentation on this?

    Thank you!

    Hi Cemerson:

    See this example:

    1. 1. create a TYPE as an object

    CREATE OR REPLACE

    TYPE GOTYOB_EQUI

    AS AN OBJECT

    (

    CDELEM VARCHAR2 (50).

    TIELEM VARCHAR2 (2)

    );

    1. 2. create a TABLE TYPE AS

    CREATE OR REPLACE

    TYPE GOTYTA_EQUI

    AS THE GOTYOB_EQUI TABLE;

    1. 3 create a function, it returns the TYPE of the TABLE

    FUNCTION fn_equiposarriba)

    pa_cdelem IN VARCHAR2,

    pa_nucomp in NUMBERS

    pa_anperi in NUMBERS

    pa_meperi in NUMBERS

    )

    Gotyta_equi RETURN PIPELINED IS

    CURSOR trae_equimani (va_cdelem VARCHAR2) IS

    SELECT cdelem, tielem, cdelempadr,

    (SELECT cdequi

    Of evm_alim

    WHERE anperi = eq.anperi

    AND meperi = eq.meperi

    AND nucomp = eq.nucomp

    AND cdalim = eq.cdalim) cdalim

    Of evm_equimani eq

    WHERE anperi = pa_anperi

    AND meperi = pa_meperi

    AND nucomp = pa_nucomp

    AND cdelem = va_cdelem

    AND cdelempadr <> cdelem

    AND tielem <> 'A ';

    equimani trae_equimani % ROWTYPE;

    va_cdalim VARCHAR2 (100);

    BEGIN

    -Loading los equipos aguas arriba

    WHILE equimani.cdelempadr IS NOT NULL LOOP

    OPEN trae_equimani (equimani.cdelempadr);

    equimani: = NULL;

    SEEK trae_equimani INTO equimani;

    CLOSE Trae_equimani;

    IF equimani.cdelem IS NOT NULL THEN

    PIPE ROW (gotyob_equi (equimani.cdelem, equimani.tielem));

    END IF;

    END LOOP;

    RETURN;

    END;

    1. 4 SQL Query with the help of the function... you can use this SQL in a display object

    SELECT

    *

    Of

    TABLE (gopq_eventos.fn_equiposarriba (' F-SCZ-043-103', '))

    1,

    2013,

    6

    )

    )

    Best regards, Marcelo

  • wanted to extract data from nested table pl/sql Ref Cursor getting an erro

    create or replace type 'DEPT12' as an object (dno number (2), dname varchar2 (30), varchar2 (50)) loc;

    create or replace type dept_tab in the table in "DEPT12".

    create or replace type 'LOC12' as an object (locno number, loc_name varchar2 (100))

    create or replace type loc_tab in the table of "LOC12.

    create or replace type dept_loc_rec1 as an object (dept_tab, eno number, loc_dt loc_tab dept_dt);

    Create type dept_loc_tb as table of the dept_loc_rec1

    create table dept_loc_tb_bk1 (dept_dt dept_tab, eno number, loc_dt loc_tab)
    NESTED TABLE dept_dt
    STORE AS dept_tab12,
    NESTED TABLE loc_dt
    STORE AS loc_tab12




    insert into dept_loc_tb_bk1 values (dept_tab (dept12(3,'ABD','LOC')
    dept12(4,'ABD','LOC')
    (, dept12(5,'ABD','LOC')), 3, loc_tab (loc12(21,'AAB'),
    loc12(22,'AAB'),
    loc12(23,'AAB')));

    When I try to extract data from Ref cursor to pl/sql table that I get an error ora-06504: pl/sql: return types of the result set of variables or request do not match.
    I created a table nested, as well as the pl/sql nested table object dept_loc_tb and I said the same dept_loc_tb lv_dept_loc_tb, but trying to get in this variable we get an error above.

    Please anyone can solve my problem.
    -----------------
    declare
    type cr is ref cursor;
    cr_obj cr;

    lv_dept_loc_tb dept_loc_tb;

    Start
    Open cr_obj to select dept_dt, eno, dept_loc_tb_bk1 loc_dt;
    collect the fetch cr_obj in bulk in lv_dept_loc_tb;
    close cr_obj;
    end;

    Your query selects 3 distinct columns requires so 3 collections of matching types. You want to treat these 3 columns as an object of type DEPT_LOC_REC1:

    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select dept_dt,eno,loc_dt from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    declare
    *
    ERROR at line 1:
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    ORA-06512: at line 9
    
    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select DEPT_LOC_REC1(dept_dt,eno,loc_dt) from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.
    P.S. discover sys_refcursor.

  • Best approach - whether to return Collections or the Ref Cursor?

    I have the table that the column is a nested table (column address) type. Now, I want to fill the same
    in a jsp page.

    As his collection type I am thinking to send variable Collection to front-end. And most of java professionals
    argue that the collections are the best approach.

    But here, in a lot of posts, I read that collections at the front end is the worst approach and it degrades performance
    and increases the load.

    But java assert that even if connection fails they can always display the data as the data set is with them
    How to get a set of results COLLECTION.

    As ref cursor is just a pointer to the real cursor lies in the comics... they're going to make one record of the other instead and once the connection is lost... they can no longer display the data. This assertion seems
    to be reasonable!

    How you condemn it? and prove ref Cursor is good way?


    Here's the example scenario that I have with me.
    create type t_adress is object(t_h_no varchar2(500),t_pin_code number);
     /
     
     create type t_address_tbl is table of t_adress;
     /
     
     create table r_dummy (emp_name varchar2(200),emp_id number,emp_address t_address_tbl)
     nested table emp_address store as emp_address_tbl;
     
     insert into r_dummy values('raghu',1,t_address_tbl(t_adress('598',500035),t_adress('600',500036)))
     
     insert into r_dummy values('raghu nadh',2,t_address_tbl(t_adress('598',500035),t_adress('600',500036)))
    Using the Collection
    Create or replace procedure p_using_col
     (
     p_emp_id          in     r_dummy.emp_name%type,
     p_emp_dtls          out     t_address_tbl
     )
     is
     begin
              Select     t_adress(cl.t_h_no,cl.t_pin_code)
              bulk collect into p_emp_dtls
              from     r_dummy,table(emp_address) cl
              where     emp_id = p_emp_id;
     
     end;
     /
     
     set serveroutput on;
     declare
              l_emp_id          r_dummy.emp_name%type := 1;
              l_emp_dtls          t_address_tbl;
     begin
              p_using_col(l_emp_id,l_emp_dtls);
              
              for i in 1..l_emp_dtls.count
              loop
              
                   dbms_output.put_line(l_emp_dtls(i).t_h_no);
              
              
              
              
              end loop;
     
     
     end;
    Using Ref Cursor
    Create or replace procedure p_using_ref
     (
     p_emp_id          in     r_dummy.emp_name%type,
     p_emp_dtls          out     sys_refcursor
     )
     is
     begin
              Open p_emp_dtls for
                   Select     cl.t_h_no,cl.t_pin_code
                   from     r_dummy,table(emp_address) cl
                   where     emp_id = p_emp_id;
     
     end;
     /
     
     set serveroutput on;
     declare
              l_emp_id          r_dummy.emp_name%type := 1;
              l_emp_dtls          sys_refcursor;
              
              l_h_no               varchar2(500);
              l_pin_code          number;
              
              
     begin
              p_using_ref(l_emp_id,l_emp_dtls);
              
                   loop
                        fetch l_emp_dtls into l_h_no,l_pin_code;
                        
                        exit when l_emp_dtls%notfound;
                        dbms_output.put_line(l_h_no||'    '||l_pin_code);
                   
                   
                   end loop;
              
                   close l_emp_dtls;
     end;
    Concerning
    RUSSO

    RUSSO says:
    I would like to know what really happens behind the screen IE in PGA... when we return collections...

    A collection is a PL/SQL variable. Like all PL/SQL variables, it resides in the global area of the server process that executes PL/SQL code. This memory is part of the process the process's private memory.

    If need more memory, more memory server be malloc' ed by the process.

    As he is dedicated and private memory, no other process can reap the benefits of this memory in use. It is not 'ideal' - shared memory however benefits all the processes that are involved in sharing that allocated the memory. As is the case with the SGA

    How long my set of data will reside in the PGA? He immediately fade after returning to the calling procedure? and how it degrades performance. Help me with a good link.

    Assume that you create a collection of 10 MB. The process server malloc' ed 10 MB of server memory. The PGA has thus extended.

    When your code executes the variable usage (it is out of reach of runtime), the PL/SQL engine can theoretically free up 10 MB of memory. However, it may have allocated 4 KB memory after this assignment of 10 MB. Only 4 KB is still in use. This moment results in that the process cannot shrink its allocated memory - as this free piece of 10 MB is slapbang in the middle of the used memory space.

    PGA memory is 'expensive' because it's not shared memory is private, with only the current process. PGA in memory is not so easy to decline. Memory management is a complex issue and you who ceases to use a large part of the PGA memory almost never means that this memory suddenly become free and available for other processes to use.

    Also, you have to ask yourself why you want to copy data from disk blocks into the SGA buffer (for SQL procedures) cache, then copy these data blocks of APG in the PGA (using a collection and extraction in bulk) and then copy this PGA memory on the network to the client process (TOAD or .net or Java or whatever).

    It's a lot of moving parts - which increases the complexity, lowers the performance and scalability and ups the risk of something going wrong due to the increased complexity.

    It is much simpler and much stronger, to maintain the number of moving parts to a minimum. For example to copy data directly from cache buffers of the SGA to the customer via a ref cursor

  • Insert data from variables in the Ref Cursor

    I do not know how to return data from ref cursor variables That's what I've tried so far...
    CREATE OR REPLACE type num_obj as object (
      t_number number ,
      t_type varchar2(10) ,
      t_desc varchar2(40)
    ); 
    CREATE OR REPLACE type num_table as table of num_obj; 
    
    procedure get_all_data(p_p1 in varchar2, p_rc OUT SYS_REFCURSOR) is
       l_dat1 number := 2;
       l_dat2 varchar2(10);
       l_dat3 varchar2(40);
       t_num_o num_obj;
       t_num_t num_table;
    begin
      for l_indx in 1..5 loop
         l_dat1 := l_dat1 + l_indx;
         if ( mod(l_dat1,2)=0) then
           l_dat2 := 'EVEN';
         else
           l_dat2 := 'ODD';
         end if;
         l_dat3 := 'Number ' || l_dat1 || ' is ' || l_dat2 || ' number'; 
         l_num_o := num_obj (l_dat1, l_dat2, l_dat3);
         l_num_t := num_table(l_num_o);
      end loop;
      open p_rc for select * from table(l_num_t);
      close p_rc;
    end;
    At the end, to achieve this in Ref Cursor:
    t_number | t_type | t_desc
    ---------------------------------------
    3        | ODD    | Number 3 is ODD number
    5        | ODD    | Number 5 is ODD number
    8        | EVEN   | Number 8 is EVEN number
    12      | EVEN    | Number 12 is EVEN number
    17      | ODD     | Number 17 is ODD number
    Can something like that, where I did wrong?

    BTW. I did this with the function in pipeline, now I want to try a different method.

    The refcursor can not be closed in the procedure - you must return refcursor open to the appellant.
    the appellant must read and then close it.
    There are also some errors in the names of variables and an assignment to the collection.

    Try this version:

    CREATE OR REPLACE
    PROCEDURE GET_ALL_DATA(P_P1 IN VARCHAR2, P_RC OUT SYS_REFCURSOR) IS
       l_dat1 number := 2;
       l_dat2 varchar2(10);
       L_DAT3 VARCHAR2(40);
       L_NUM_O NUM_OBJ;
       l_num_t num_table := num_table() ;
    BEGIN
      for l_indx in 1..5 loop
         l_dat1 := l_dat1 + l_indx;
         if ( mod(l_dat1,2)=0) then
           l_dat2 := 'EVEN';
         else
           l_dat2 := 'ODD';
         end if;
         l_dat3 := 'Number ' || l_dat1 || ' is ' || l_dat2 || ' number';
         L_NUM_O := NUM_OBJ (L_DAT1, L_DAT2, L_DAT3);
         L_NUM_T.EXTEND;
         l_num_t( l_indx ) := l_num_o;
      end loop;
      OPEN P_RC FOR SELECT * FROM TABLE(L_NUM_T);
    END;
    /
    
    SQL> variable xx refcursor
    SQL> execute GET_ALL_DATA( '', :xx );
    
    PL/SQL procedure successfully completed.
    
    SQL> print :xx
    
      T_NUMBER T_TYPE     T_DESC
    ---------- ---------- ----------------------------------------
          3 ODD           Number 3 is ODD number
          5 ODD           Number 5 is ODD number
          8 EVEN       Number 8 is EVEN number
         12 EVEN       Number 12 is EVEN number
         17 ODD           Number 17 is ODD number
    
  • Ref Cursor is supported by their SUMMIT?

    Version 3.2 of the apex
    ORacle 10G

    Hi Ashalon,

    I don't have access to this book, so it is difficult to answer for what he says, but the PIPELINED function should return a type of collection (nested table or varray) - that would be a table of 'something '. That "something" could be a type of object defined by you (if the REF CURSOR data structure are correlated to a specific table) or simply a line-type I made for simplicity. Yes, my example is a nested table type.

    If I can make a suggestion - play with the concepts of packaging your routines back REF CURSOR in PIPELINED functions using just the SQL or SQL command window * more before trying to integrate them into an ApEx application. Less variable to deal with at the same time.

    Hope this helps,
    John

    If you find this information useful, please do not forget to mark the 'useful' or 'correct' post so that others benefit as well.

  • Problem with weakly typed ref Cursor

    I have problem with a procedure in a package that returns a weakly typed reference cursor.
    The cursor that is returned to give the desired result when connected as sys and sysdba.
    But the user has rights of execution on the slider isn't a result.
    If I run the query for the cursor as a user I get the desired result
    I tried creating a new procedure outside of the package and it still doesn't work the way I want it.

    I tested changing authentication none in sqlnet.ora and still no results

    Procedure
    create or replace procedure ReportUnits (in the SYS_REFCURSOR cResult)
    AS
    Start

    Open the cResult for
    Select distinct c.company, c.name, c.companycode
    all_views o, fakta.balance_table b, fakta.company c
    where b.company = c.company
    and o.view_name like upper(b.company ||) '_' || b.balance_table | '_view %');

    end ReportUnits;
    Tried the two SYS_REFCURSOR and
    Typedef t_cursor as ref cursor;

    I get no error message.

    802379 wrote:
    Sorry user_views does not solve the problem using all user_views I get no result points of view because interested does not belong to the user.

    So who owns the upper(b.company ||) '_' || b.balance_table | views of '_view' %)? And the package is created with copyrighted (by default) or with authid current_user? If the package is created with copyrighted, it still operates as package regardles of owner who runs it. Package owner (not the appellant) must have accsess to view granted directly, without going through role (rights define stored objects do honor no roles). And since rights define package runs as the owner of package, all_views will show views package owner has access, not package calling.

    One last thing - what happens if more than one schema has upper(b.company ||) '_' || b.balance_table | views of '_view' %)? Do you want them or only in a specific schema?

    SY.

  • Need the difference between strong Ref Cursor and weak Ref Cursor examples

    Oracle 9.2

    It would be great if someone can help understand the differences between
    1 Strong Ref Cursors(return type)
    and
    2. weak Ref Cursor (no return type)

    What I read is weak ref Cursor as sys_refcursor is better to use the ref Cursor, because in the case of slider strong Ref object type that will be returned must be declared in advance. It dosent make sense to me?

    I start with the examples would be appreciate for advice

    Strong Ref Cursor

    create the package str_pack
    is
    type sref_type is ref cursor return emp % rowtype;
    SVAR sref_type;
    end str_pack;

    Create procedure st_proc (eid in number, c1 on str_pack.sref_type)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    declare
    str_pack.sref_type C1;
    type rec is RECORD (eid, ename varchar2 number (20), number of sal);
    SheikYerbouti rec;
    Start
    st_proc(10,C1);
    loop
    When exit c1% notfound;
    Fetch c1 into SheikYerbouti.
    end loop;
    Close c1;
    end;


    There could be errors in the above example but its basically to get a better understanding.

    For weak Ref Cursor

    procedure of the child

    Create procedure child_proc (in number, c1 on sys_refcursor eid)
    is
    Start
    Open c1 to select empno, ename, sal from emp where empno = eid;
    end;

    parent process

    Create procedure parent_proc (recnum varchar2)
    is
    p_retcur sys_refcursor;
    emp_row emp % rowtype;
    Start
    child_proc (eid, p_retcur);
    loop
    extract the p_retcur in emp_row;
    dbms_output.put_line(emp_row.empno ||) e '|| emp_row. Ename | "wins". emp_row. SAL);
    end loop;
    end parent_proc;

    Concerning
    @

    Hello

    the fundamental difference is to do with the compiling and linking of runtime type that occurs.

    The he should explain a lot more detail than I could ever!
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1640161160708

    P;

  • Call a procedure stored via JDBC with a REF CURSOR * input variable.

    Hello

    S/n of my client has provided me with a stored procedure that I need to call to get information about products prices. Something along the lines of:

    some_package.getPrices (products IN OUT csr_type);

    where csr_type represents a REF CURSOR. This cursor has a product ID column and a price column. The plan is to move the cursor with the populated product id column and have the routine decorate the slider with the prices.

    The setting in this plan is that it seems that it is not possible to go from JDBC REF CURSOR in . However, I'm not sure, since I can only find throw comments on various forums (e.g. http://www.orafaq.com/forum/t/35088/0/), without any reference. If I go back to the client and tell them that their idea will not work, I prefer to be able to point them to a documentation somewhere

    So I guess my questions are:

    1. it is indeed impossible to pass a REF CURSOR type as a variable input on JDBC to a stored procedure?

    2. is there information I can do about my client?

    3. am I on the right track thinking I need to go down the path of an array of objects?

    Thank you very much to anyone who can help
    Peter Svehla.

    Hi Peter,.

    I see it, missed that you actually want to pass in a list of products. Don't think that you can do this with the current procedure. A slider is just a pointer to a result set.
    How the result set is created and what it looks like, is determined when the cursor is opened.

    What does this procedure with the cursor? -It does not have some OPEN TO ; inside?

    Or, perhaps, you are supposed to send in an open cursor (does not much sense to me)?

    Concerning
    Peter

  • How to create control provided by PL/SQL ref-cursor

    Dear valuable experts,

    I'm migrating oracle forms10g for JDeveloper. Currently I need a guideline or a reference to create pages of the ADF using the PL/SQL-Refcursor rather then tables or views.

    I need help also how can I create using PL/SQL (package) - Refcursor datacontrol.

    Please help me.

    (!)
    Thank you.
    Zed
    ====

    Zed,

    The Fusion developer's Guide has 35.9.4 article titled "How to create a view object on a REF CURSOR" which should help you.

    John

Maybe you are looking for

  • Can not configure my Satellite with sky to become wireless

    I recently moved home and now have sky broadband.I've used my wireless laptop but cannot put up with the sky to become wireless. After talking to sky, nobody knows why this is happening.I'd appreciate any help or advice I hate to be tied to one place

  • Carrying case for Portege R500?

    I'm looking for a pretty tight case, preferably not too bulky, for my Portege R500. I'll use it for travel, so it should be robust (so not something as a sleeve or whatever it is). Any ideas?

  • 18.5V and 19.5V power supply compatibility, nc4200

    Hello I have a notebook nc4200 who needs a new power supply.  I chatted with a HP consultant and he said I could use one of the new 90W slim smart adapters for it, but who has 19.5V output (whereas the original adapter 65W 18.5V).  Smart «Say» networ

  • win xp x 86 (kb2686828)... failed!

    In addition, win xp x 86 (kb2604092)... failed! win xp x 86 (kb2656369)... failed! What is the solution?

  • HP LaserJert 5200tn tray 3 not configurable

    In order to have our design software to take the right for every different paper tray, we must triple (once for each tray) this printer (Laserjet 5200tn). We did successfully on all our XP systems using the disc that came with the printer. We are cur