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

Home -> Community -> Usenet -> c.d.o.server -> Re: Q about TRUCATE command within stored procedure

Re: Q about TRUCATE command within stored procedure

From: PaulCinVT <paulcinvt_at_aol.com>
Date: 28 Jul 1999 19:18:35 GMT
Message-ID: <19990728151835.03573.00001794@ngol01.aol.com>


CREATE OR REPLACE PROCEDURE SYSTEM.TRUNCATE_TABLE (table_name IN VARCHAR2) AS

   cid INTEGER;
BEGIN
/* Open new cursor and return cursor ID. */
   cid := DBMS_SQL.OPEN_CURSOR;
/* Parse and immediately execute dynamic SQL statement built by

      concatenating table name to TRUNCATE TABLE command. */    DBMS_SQL.PARSE(cid, 'TRUNCATE TABLE ' || table_name, dbms_sql.v7);
/* Close cursor. */

   DBMS_SQL.CLOSE_CURSOR(cid);
EXCEPTION
/* If an exception is raised, close cursor before exiting. */
   WHEN OTHERS THEN

      DBMS_SQL.CLOSE_CURSOR(cid);
      RAISE;  -- reraise the exception

END TRUNCATE_TABLE; Paul in VT Received on Wed Jul 28 1999 - 14:18:35 CDT

Original text of this message

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