I would like to write db2 command which find out first database exist or not and if exist that data base then drop this database and create a new updated database .
Please help for same
I would like to write db2 command which find out first database exist or not and if exist that data base then drop this database and create a new updated database .
Please help for same
There is not a command or language in DB2 that support that instruction. You have to define what to do when the given name exist as an alias of a database (not the real name of the database), drop the alias? rename it?
The script will look like:
calling this function will let you drop the table if exist:
CALL FNC.DROP_IF_EXISTS('TABLENAME')!