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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Execute Immediate and Cursors

RE: Execute Immediate and Cursors

From: Kevin Lange <klange_at_ppoone.com>
Date: Tue, 15 Jun 2004 08:35:54 -0500
Message-ID: <ED1256BD4F253C44B1627B2D365A334F0208B421@ppoone1.ppoone.com>


Thanks Melanie.

-----Original Message-----
From: Melanie Caffrey [mailto:melanie_caffrey_at_yahoo.com] Sent: Monday, June 14, 2004 6:22 PM
To: oracle-l_at_freelists.org
Subject: RE: Execute Immediate and Cursors

OK.

He can still use a ref cursor with native dynamic sql.

No need for the execute immediate verb, though.

CREATE OR REPLACE PROCEDURE get_my_cursor

                        (p_column IN  <your choice>,
                         p_table IN  <your choice>,
                         p_predicate IN <your choice>,
                         p_jobid  IN  dept.jobid%TYPE,
                         p_cursor OUT SYS_REFCURSOR)

sql_stmt VARCHAR2(1000);
job_rec dept%ROWTYPE;

BEGIN sql_stmt := 'SELECT job_name, :c

               FROM :t
              WHERE :w > :j';

 OPEN p_cursor FOR sql_stmt

    USING p_column, p_table, p_predicate, p_jobid;  LOOP
    FETCH p_cursor INTO job_rec;
    EXIT WHEN p_cursor%NOTFOUND;

    .
    .
    .

 END LOOP;
 CLOSE p_cursor;

END;


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request_at_freelists.org
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jun 15 2004 - 08:32:55 CDT

Original text of this message

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