You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Deepak Abraham (JIRA)" <ji...@apache.org> on 2017/11/23 12:58:18 UTC

[jira] [Commented] (DERBY-4842) Support "IF [NOT] EXISTS" in CREATE TABLE and "IF EXISTS" in DROP TABLE

    [ https://issues.apache.org/jira/browse/DERBY-4842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264291#comment-16264291 ] 

Deepak Abraham commented on DERBY-4842:
---------------------------------------

SQL standard or not - please lets not wait for the standard to become up to date -  this feature would be really useful especially while testing when all the statements are in a .sql file which is executed en-masse via plain JDBC or via a framework. 
Typically before the _create _a _drop table if exists <table-name> _ could be there or the create could have an _if exists_. This makes running the same test which 
* drops and re-creates the table, (via an sql file)
* inserts some data (via same sql file)
* does some db testing (via sql file or manual JDBC queries)

All very easy. Otherwise the drop statement has to be put in java code, which is painful.

> Support "IF [NOT] EXISTS" in CREATE TABLE and "IF  EXISTS" in DROP TABLE 
> -------------------------------------------------------------------------
>
>                 Key: DERBY-4842
>                 URL: https://issues.apache.org/jira/browse/DERBY-4842
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Adrian Tarau
>              Labels: derby_triage10_10
>
> It would be really great if Derby will support these additions similar with what MySQL has.
> Also a way to disable constraints when dropping the whole database, so you would not be forced to put DROPs in such an order that constraints will not fail. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)