Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> store results from function into two seperate variables???

store results from function into two seperate variables???

From: <jeffchirco_at_gmail.com>
Date: 8 Aug 2005 07:58:10 -0700
Message-ID: <1123513090.067040.164590@g43g2000cwa.googlegroups.com>

I have created a package the returns a ref cursor. The package is as follows:
CREATE OR REPLACE PACKAGE p_storedivreg_hist is

end p_storedivreg_hist;

create or replace package body p_storedivreg_hist . is

RETURN rset;

end;

end p_storedivreg_hist;

When I run it in sqlplus;
select p_storedivreg_hist.results(32) from dual;

I get:
CURSOR STATEMENT : 1 CURSOR STATEMENT : 1 DBDIV DBREG
---------- ----------
1683 2943

1 row selected.

1 row selected.

Or I can run it by:
SQL> var c refcursor
SQL> exec :c := p_storedivreg_hist.results(32);

PL/SQL procedure successfully completed.

op_user_at_inotest> print c;

DBDIV DBREG
---------- ----------
1683 2943

My question is, is there a way to store the results into two seperate varaibles in a function or a procedure? Thanks for all help. Do in select p_storedivreg_hist.results(32) into x,y from dual; Does not work. Received on Mon Aug 08 2005 - 09:58:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US