Thank you :)
Le vendredi 15 septembre 2006 à 01:55 +0200, Bernt M. Johnsen a écrit :
> 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 ,
> >
>
>