The exported DDL of a Diagram in Derby mode with the option "With DROP TABLE statement" generate the following invalid Derby-SQL statement:
DROP TABLE IF EXISTS TABLENAME;
"IF EXISTS" is not a valid Derby-SQL syntax, just "DROP TABLE" is allowed. I did investigate this issue on Derby, but it seem there is no pure SQL solution to workaround this problem, it can only be done programmatically:
The exported DDL of a Diagram in Derby mode with the option "With DROP TABLE statement" generate the following invalid Derby-SQL statement:
DROP TABLE IF EXISTS TABLENAME;
"IF EXISTS" is not a valid Derby-SQL syntax, just "DROP TABLE" is allowed. I did investigate this issue on Derby, but it seem there is no pure SQL solution to workaround this problem, it can only be done programmatically:
http://old.nabble.com/Equivalent-of-SQL-%22DROP-TABLE-IF-EXISTS-MY_TABLE%22---td957500.html
So, my proposal is to change the generation from:
DROP TABLE IF EXISTS TABLENAME;
To:
DROP TABLE TABLENAME;
This will generate an exception if the table doesn't exists, but at least the syntax is correct.
Cheers