Answers for "create table if doesn't exist sql"

SQL
0

create table if not exists sql

CREATE TABLE IF NOT EXISTS

> CREATE TABLE IF NOT EXISTS TEAMS
> (TEAMNO      INTEGER NOT NULL PRIMARY KEY,
> EmployeeNO    INTEGER NOT NULL,
> DIVISION    CHAR(6) NOT NULL);
Posted by: Guest on April-27-2020
0

Create table if not exist

declare
nCount NUMBER;
v_sql LONG;

begin
SELECT count(*) into nCount FROM dba_tables where table_name = 'EMPLOYEE';
IF(nCount <= 0)
THEN
v_sql:='
create table EMPLOYEE
(
ID NUMBER(3),
NAME VARCHAR2(30) NOT NULL
)';
execute immediate v_sql;

END IF;
end;
Posted by: Guest on November-16-2021

Code answers related to "create table if doesn't exist sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language