HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

DB2 equivalent for MySQL's DROP .. IF EXISTS

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
equivalentdb2dropmysqlforexists

Problem

Is there an equivalent in DB2 for MySQL's (or PostgreSQL's):


DROP TABLE IF EXISTS sometable;

Solution

No.

You'll need an IF clause to check for the existence of the table and then a separate statement to actually drop it if it does exist.

Context

StackExchange Database Administrators Q#9535, answer score: 4

Revisions (0)

No revisions yet.