1

In Sql I check if a table exist with this code:

IF NOT EXISTS (SELECT NAME FROM SYSOBJECTS  
     WHERE NAME = 'Plane')
   CREATE TABLE Plane(Flight int)

How to do this check if a table not exist then i create it in Oracle because it throws exception if i try to create already existing table?

Dominating
  • 2,890
  • 7
  • 25
  • 39
  • possible duplicate of [Oracle: If Table Exists](http://stackoverflow.com/questions/1799128/oracle-if-table-exists) – devnull Mar 19 '14 at 03:12

2 Answers2

2

you can check the data dictionary for that table

select table_name from user_tables where table_name='MYTABLE';
Mansuro
  • 4,558
  • 4
  • 36
  • 76
1

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name (create_definition,...) [table_options] [partition_options]

Loay
  • 39
  • 3