Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Dynamicly build Cursor
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