doh, let me take that back.

If I re-create exactly as in your example, the problem comes in from the fact that I can't see the table in the ALL_TABLES view. You might have to have select privs on the table in order to use this particular piece of code...

[email protected]> desc abc.xxx
Name Null? Type
----------------------------------------- -------- ----------------
X CHAR(1)

[email protected]> l
1 declare
2 t1 number;
3 begin
4 select count(1) into t1
5 from all_tables where owner='ABC' and table_name='XXX';
6 if (t1=1) then
7 dbms_output.put_line('dropping tab...');
8 execute immediate 'drop table ABC.XXX';
9 end if;
10* end;
[email protected]> /

PL/SQL procedure successfully completed.