Home » SQL & PL/SQL » SQL & PL/SQL » Re: Problem with a procedure
Re: Problem with a procedure [message #37270] Mon, 28 January 2002 09:44
andrew again
Messages: 2577
Registered: March 2000
Senior Member
no problem, use dynamic sql. Just cut the contents of the following proc, or create the proc so you can re-use it.

CREATE OR REPLACE PROCEDURE DYNSQL (p_sql in VARCHAR2) iS
c_id PLS_INTEGER default dbms_sql.open_cursor;
o_count PLS_INTEGER;
BEGIN
dbms_sql.parse (c_id, p_sql, dbms_sql.native);
o_count := dbms_sql.execute(c_id);
dbms_sql.close_cursor(c_id);
EXCEPTION
WHEN OTHERS THEN
dbms_sql.close_cursor(c_id);
DBMS_OUTPUT.PUT_LINE ( 'dynsql failed' );
END;
/
Previous Topic: Re: Optimizer Question
Next Topic: How do I return recordset from Oracle
Goto Forum:
  


Current Time: Thu Mar 28 14:50:30 CDT 2024