0

I am trying to implement an IF statement that will run a method to check if a database table currently exists on Oracle SQL developer then if it does not exist it will not drop the table however if it does exist then it will drop that table and create a new one. This is the following code I have to drop the table.

    stmt.executeUpdate("DROP TABLE ASS2_FILM");
gw95
  • 41
  • 7
  • Why not just drop the table and catch and handle the exception which occurs if the table isn't already there? – Boneist Mar 22 '17 at 14:09
  • can you show me the code for this it would be of a great help – gw95 Mar 22 '17 at 14:15
  • 1
    @Boneist - I was thinking the same thing. Probably not in the same block where you would want to drop the table (if that errors out you will be in the error-handling section and you won't be able to do the rest of your work), but in its own nested block within the "current" one. –  Mar 22 '17 at 14:18

0 Answers0