How about writing a shell script which would connect to the database, test for existence of the table and if so, drop the table?
Or, do you care if one issues a DROP TABLE and the table doesn't exist?
Im not sure if I care if i drop a table which doesnt exist.. what happens? If an error message is simply generated tehn thats fine.
The main point of the question was if i can have multiple sql statements inside a single text file. I just want my batch file to run the sql file. Im working in a restricted environment so that has to be the format. One batch file which just runs the one sql file
Sure thing. You can have multiple SQL statements in a "batch" file.
And if there's a DROP TABLE tablename and the table doesn't exist, so the output would be something like:
db2 drop table x
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0204N "schemaname.X" is an undefined name. SQLSTATE=42704