db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <karth...@gmail.com>
Subject Re: DROP IF NOT EXISTS
Date Thu, 14 Sep 2006 21:37:24 GMT
yves pielusenet wrote:

>I wonder if there is something similare like :
>'drop index id_index if not exists' ?
>I want to put a condition on a drop statement but it fails.
>how can I do ?
>
>thanks ,
>
>  
>
Did you mean 'DROP INDEX <name> IF EXISTS ?

In any case, currently Derby does not support IF EXISTS in the DROP 
statement.

Not sure if this helps:
But, if you are using  JDBC, you could execute the 'DROP INDEX <name>' , 
catch the
SQLException to check for  the SQLState of  42X65 and print a useful 
message instead stating
index does not exist. If the index exists the drop should go through 
successfully.

-Rajesh

Mime
View raw message