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 -> Re: Dynamicly build Cursor

Re: Dynamicly build Cursor

From: Scott Metzger <scottmetzger_at_my-deja.com>
Date: Mon, 08 Jan 2001 17:36:31 GMT
Message-ID: <93ctqu$str$1@nnrp1.deja.com>

I am not exectly sure what your question is. If you are trying to build a query at run time within a PL\SQL procedure you can do that with the DBMS_SQL package. Here is an example:
CREATE OR REPLACE PROCEDURE Debug( Section In Varchar2, PrintMe IN Varchar2) as
 TCursor INTEGER;
 ODebug Varchar2(40);
 Dummy INTEGER;
BEGIN
 TCursor := DBMS_SQL.OPEN_CURSOR;
 DBMS_SQL.PARSE(TCursor, 'insert into TDebug (Section, Out) values ('''||Section||''','''||PrintMe||''')', DBMS_SQL.V7);  Dummy := DBMS_SQL.EXECUTE(TCursor);
 DBMS_SQL.CLOSE_CURSOR(TCursor);
END;
/

Sent via Deja.com
http://www.deja.com/ Received on Mon Jan 08 2001 - 11:36:31 CST

Original text of this message

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