Ticket #23462

DROP TABLE invalid syntax for Derby DDL export

오픈 날짜: 2010-10-19 17:20 마지막 업데이트: 2010-10-20 02:37

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None

Details

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

Ticket History (3/3 Histories)

2010-10-19 17:20 Updated by: cjenkins
  • New Ticket "DROP TABLE invalid syntax for Derby DDL export" created
2010-10-20 02:32 Updated by: takezoe
  • 소유자 Update from (None) to takezoe
2010-10-20 02:37 Updated by: takezoe
  • Resolution Update from None to Fixed
  • Status Update from Open to Closed
  • Ticket Close date is changed to 2010-10-20 02:37
댓글 올리기

I removed "IF EXISTS" from the table drop statement which is generated by DerbyDialect in the SVN trunk.

Please wait for the next release, and thanks for your feedback!

Attachment File List

No attachments

Edit

Please login to add comment to this ticket » Login