Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How can i drop a table in a PL/SQL Block
> ...
> select count(*) into aux from user_tables
> where table_name = 'XXX';
> if SQL%FOUND then
> DROP TABLE XXX;
> end if;
> end;
>
> How can i do this.
This code can execute any special SQL
v_sql := 'DROP TABLE XXX';
special_sql(v_sql);
PROCEDURE special_sql (p_sql VARCHAR2)
as
ch INTEGER;
begin
ch := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(ch,p_sql,DBMS_SQL.NATIVE);
DBMS_SQL.CLOSE_CURSOR(ch);
commit work;
end special_sql;
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Nov 22 1999 - 14:09:49 CST
![]() |
![]() |