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 ?
> 

You could do it like this:

try {
   stmt.executeUpdate("drop index id_index");
} catch (SQLException e) {
    if (!e.getSQLState().equals("xxxxx") {
        throw e;
    }
}


where xxxxx is the SQL State you get when trying to delete a
non-existing index.

> thanks ,
> 


-- 
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

Reply via email to