I am porting an application to DB2 which is now working on MSSQL
server. They have used conditional statements to check whether a table
already exists before trying to create a table. Something like this:
if not exists (select * from sysobjects where id =
object_id(N'testtable') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE ...
I tried to use the same logic in DB2 but it reported errors. When I
posted the error to ibm newsgroup I was told by Mr. Dirk that DDLs are
not allowed with in dynamic statements, so I cannot use in this way.
So how do I implement the same in the case of DB2.
thanks in advance,