Skip to content

Commit f55ea6c

Browse files
authored
Create if-not-exists.sql
1 parent 2ba10ba commit f55ea6c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
REM Script in 23c: if-not-exists.sql
2+
3+
-- suppose table DEPT exists
4+
desc dept
5+
6+
-- try several times, no error occurs
7+
create table if not exists scott.dept (deptno number, dname varchar2(10), loc varchar2(15));
8+
9+
-- create a helper table
10+
create table dept1 as select * from dept;
11+
12+
-- drop several times, no error occurs
13+
drop table if exists dept1;

0 commit comments

Comments
 (0)