tabela de queda SQL se existir
DROP TABLE IF EXISTS dbo.Customers
Relieved Rook
DROP TABLE IF EXISTS dbo.Customers
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);
CREATE TABLE IF NOT EXISTS [schema_name].table_name (...);
CREATE TABLE IF NOT EXISTS Companies (
id int,
name varchar(50),
address text,
email varchar(50),
phone varchar(10)
);
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;