I am working on an 11G instance, so the IF EXISTS functionality is not available.
Here is what I would like to do, logically:
IF (SELECT COUNT(*) RECORDS FROM ALL_TABLES WHERE TABLE_NAME = 'CRAFT') > 0 THEN
DROP TABLE 'CRAFT';
END IF;
For simplicity, I did not include the Owner to ensure uniqueness on the result. But, concept is simple. Use a select statement to count the number of records with this table name and if that number is greater than (0) that it executes the inner code.
When I run this code in SQL Developer, I get an error relating to the IF statement.
So, what would the syntax look like to do this conditional drop?
Thanks.