fixes bug#22049
qua:junia,waly,willian dev: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@106650 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
09a4cd54f6
commit
2ff96bba8b
|
@ -0,0 +1,164 @@
|
|||
declare
|
||||
dup_val_on_index exception;
|
||||
except_02291 exception;
|
||||
|
||||
pragma exception_init (dup_val_on_index , -00001);
|
||||
pragma exception_init (except_02291 , -02291);
|
||||
begin
|
||||
execute immediate 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID)
|
||||
VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM >> ESQUEMA OPERACIONAL >> GERAR CONEXÃO POR LINHA'',
|
||||
''COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONEXIONPORRUTA'', 1,
|
||||
SYSDATE, -1)';
|
||||
exception
|
||||
when dup_val_on_index then null;
|
||||
when except_02291 then null;
|
||||
end;
|
||||
|
||||
/
|
||||
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE CONEXION_RUTA_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CONEXION_RUTA_CTRL
|
||||
(CONEXIONRUTACTRL_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
RUTA_ORIGEN_ID NUMBER(7,0),
|
||||
RUTA_DESTINO_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
PRIMARY KEY (CONEXIONRUTACTRL_ID) ENABLE
|
||||
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
|
||||
/
|
||||
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE CONEXION_RUTA_TRAMO_CTRL_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CONEXION_RUTA_TRAMO_CTRL
|
||||
(CONEXIONRUTATRAMOCTRL_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
CONEXIONRUTACTRL_ID NUMBER(7,0),
|
||||
ORIGEN_ID NUMBER(7,0),
|
||||
DESTINO_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
PRIMARY KEY (CONEXIONRUTATRAMOCTRL_ID) ENABLE,
|
||||
FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONEXION ADD (RUTA_ID NUMBER(7,0))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
|
||||
declare
|
||||
column_exists exception;
|
||||
pragma exception_init (column_exists , -01430);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONEXION ADD (CONEXIONRUTATRAMOCTRL_ID NUMBER(7,0))';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
column_exists exception;
|
||||
except_02275 exception;
|
||||
|
||||
pragma exception_init (column_exists , -01430);
|
||||
pragma exception_init (column_exists , -02275);
|
||||
begin
|
||||
execute immediate 'ALTER TABLE CONEXION ADD CONSTRAINT FK_CONEXION_RUTA_TRAMO FOREIGN KEY (CONEXIONRUTATRAMOCTRL_ID)
|
||||
REFERENCES CONEXION_RUTA_TRAMO_CTRL(CONEXIONRUTATRAMOCTRL_ID)';
|
||||
exception when column_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE CONEXIORUTAEXCEPCIOTIPOPTA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CONEXION_RUTAEXCEPCIONTIPOPTA
|
||||
(CONEXIONRUTATIPOPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
CONEXIONRUTACTRL_ID NUMBER(7,0),
|
||||
TIPOPTOVTA_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
PRIMARY KEY (CONEXIONRUTATIPOPTOVTA_ID) ENABLE,
|
||||
FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID),
|
||||
FOREIGN KEY (TIPOPTOVTA_ID) REFERENCES TIPO_PTOVTA (TIPOPTOVTA_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
/
|
||||
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE SEQUENCE CONEXIORUTAEXCEPCIONPTOVTA_SEQ MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER NOCYCLE';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
|
||||
/
|
||||
declare
|
||||
object_exists exception;
|
||||
pragma exception_init (object_exists , -00955);
|
||||
begin
|
||||
execute immediate
|
||||
'CREATE TABLE CONEXION_RUTA_EXCEPCION_PTOVTA
|
||||
(CONEXIONRUTAPTOVTA_ID NUMBER(7,0) NOT NULL ENABLE,
|
||||
CONEXIONRUTACTRL_ID NUMBER(7,0),
|
||||
PUNTOVENTA_ID NUMBER(7,0),
|
||||
ACTIVO NUMBER(1,0),
|
||||
FECMODIF DATE,
|
||||
USUARIO_ID NUMBER(7,0),
|
||||
PRIMARY KEY (CONEXIONRUTAPTOVTA_ID) ENABLE,
|
||||
FOREIGN KEY (CONEXIONRUTACTRL_ID) REFERENCES CONEXION_RUTA_CTRL (CONEXIONRUTACTRL_ID),
|
||||
FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID)
|
||||
)';
|
||||
exception when object_exists then null;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue