33 lines
1010 B
SQL
33 lines
1010 B
SQL
declare
|
|
object_exists exception;
|
|
pragma exception_init (object_exists , -00955);
|
|
begin
|
|
execute immediate
|
|
'CREATE TABLE ORGAO_EMP_PARAM
|
|
(
|
|
ORGAOEMPPARAM_ID NUMBER(15) NOT NULL,
|
|
ORGAOCONCEDENTE_ID NUMBER(7,0) NULL,
|
|
EMPRESA_ID NUMBER(7,0) NULL,
|
|
INDEMITESEGUNDAVIA NUMBER(1,0) DEFAULT 1 NULL,
|
|
INDDOISCUPOMEMBARQUE NUMBER(1,0) DEFAULT 1 NULL,
|
|
ACTIVO NUMBER(1) NULL,
|
|
FECMODIF DATE NULL,
|
|
USUARIO_ID NUMBER(7) NULL,
|
|
PRIMARY KEY (ORGAOEMPPARAM_ID),
|
|
FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA,
|
|
FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE
|
|
)';
|
|
|
|
exception when object_exists then null;
|
|
end;
|
|
/
|
|
declare
|
|
object_exists exception;
|
|
pragma exception_init (object_exists , -00955);
|
|
begin
|
|
execute immediate
|
|
'CREATE SEQUENCE ORGAO_EMP_PARAM_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';
|
|
|
|
exception when object_exists then null;
|
|
end;
|