Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Reg. 'drop table' statement
qazmlp schrieb:
> I want to drop the table where table names ends with 'TESTTABLE'.
> I tried with this:
> drop table (select tname where tname like '%TESTTABLE');
>
> But, it does not work.
>
> Please help me to fix it.
>
> Thanks!
that wouldnt work. but try a bit of pl/sql with an execute immediate:
declare
cursor my_cur IS
select table_name from tabs where table_name like '%TESTTABLE';
begin
for tab in my_cur
loop
execute immediate 'drop table '||tab.table_name;
end loop;
end;
/
I havent run the code (dont want to drop anything), but it should work.
Reagards
Christof
ps: please dont cross-post!!! Received on Mon Aug 18 2003 - 08:12:51 CDT