Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Truncate in a procedure?
No, but you have to do it with dynamic sql like:
PROCEDURE exec_sql(p_string IN VARCHAR2 )
IS
l_cursor_name INTEGER;
l_help INTEGER;
BEGIN
l_cursor_name := dbms_sql.open_cursor;
dbms_sql.parse(l_cursor_name, p_string, DBMS_SQL.V7);
l_help := dbms_sql.execute(l_cursor_name);
dbms_sql.close_cursor(l_cursor_name);
END;
END coa_sql;
exec_sql('truncate table a_table');
Met vriendelijke groet,
/'^'\ Arno ( o o ) -----------------------oOOO--(_)--OOOo----------
Arno Disser
SFS/Pensioenen en Verzekeringen
FAD/ICT/DBA
Postbus 11
2280 AA RIJSWIJK The Netherlands
Tel +31 (0)70 33 66 389 Fax +31 (0)70 31 93 884
-----Oorspronkelijk bericht-----
Van: Smith, Ron L. [mailto:rlsmith_at_kmg.com]
Verzonden: vrijdag 16 februari 2001 16:50
Aan: Multiple recipients of list ORACLE-L
Onderwerp: Truncate in a procedure?
I have a developer that is trying to truncate a table from within a procedure. If he does a delete it works ok. If he tries to issue the truncate command he gets errors. He is running the procedure as the schema owner. Is there a problem with issuing a truncate command from within a procedure?
Ron Smith
Database Administration
rlsmith_at_kmg.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Smith, Ron L.
INET: rlsmith_at_kmg.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Disser, Arno
INET: a.disser_at_sfs.nl
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Feb 16 2001 - 12:00:47 CST