DB2 Drop table if exists equivalent

后端 未结 5 2159
既然无缘
既然无缘 2020-12-18 23:07

I need to drop a DB2 table if it exists, or drop and ignore errors.

5条回答
  •  暖寄归人
    2020-12-18 23:52

    Try this one:

    IF EXISTS (SELECT name FROM sysibm.systables WHERE name = 'tab_name') THEN
    DROP TABLE tab_name;END IF;
    

提交回复
热议问题