1

I need to drop table in Oracle with SQL Developer I did this :

DROP TABLE IF EXISTS employees;

but it's not working it's giving me this error: "SQL command not properly ended" What is the right way to drop tables in Oracle SQL Developer? Thank you

Jamal
  • 31
  • 5
  • I saw it and tried it but didn't work, i got confuse on where to put the table name – Jamal Jun 08 '20 at 02:12
  • A quick google search indicates Oracle does not have a `IF EXISTS` clause for `DROP`. [sqlines MySQL to Oracle reference](http://www.sqlines.com/mysql-to-oracle/drop_table_if_exists#:~:text=IF%20EXISTS%20in%20Oracle,the%20table%20does%20not%20exist.) – gridtrak Jun 08 '20 at 02:24
  • Yes I look it up but it's very confusing, i need help to understand what they did – Jamal Jun 08 '20 at 02:26

1 Answers1

0

Oracle doesn't really have an "IF EXISTS" or "IF NOT EXISTS" clause for any DDL commands. Just use

DROP TABLE employees;
pmdba
  • 6,457
  • 2
  • 6
  • 16