If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Keep in mind that you also need the TABSCHEMA column to uniquely qualify a row in the SYSCAT.TABLES. Also, not all entries in SYSCAT.TABLES are base tables (some are views, nicknames, etc), so use the TYPE column if that matters to you.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
use case .. when statement , to drop table , if exists.
sample as below
select case when exist ( select 'X' from sysibm.systables where name 'PSLOCK' ) then ' drop table '||name else ' ' end from sysibm.systables where name = 'PSLOCK' and type = 'T'