From 966843ee09d148f2393f40a757f7dcbdce8203d1 Mon Sep 17 00:00:00 2001 From: thiago Date: Tue, 4 Jun 2019 14:06:18 +0000 Subject: [PATCH] fixes bug#14537 fixes bug#14332 dev:Alberto qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@94109 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20190530_1500__mantis14485.sql | 17 +++++++++++++++++ .../migration/V20190530_1500__mantis14485.sql | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 src/db/migration/V20190530_1500__mantis14485.sql create mode 100644 src/db/postgresql/migration/V20190530_1500__mantis14485.sql diff --git a/src/db/migration/V20190530_1500__mantis14485.sql b/src/db/migration/V20190530_1500__mantis14485.sql new file mode 100644 index 000000000..55eaabe70 --- /dev/null +++ b/src/db/migration/V20190530_1500__mantis14485.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO,CVESISTEMA,INDEXIBECANCEL) + values ((select max(id) from( +select min_a - 1 + level id + from ( select min(motivocancelacion_id) min_a + , max(motivocancelacion_id) max_a + from motivo_cancelacion + ) + connect by level <= max_a - min_a + 1 + minus + select motivocancelacion_id + from motivo_cancelacion)),''REJEICAO SEFAZ'',''B'',null,null,''1'',SYSDATE,''1'',null,''REJEICAO_SEFAZ'',null)'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190530_1500__mantis14485.sql b/src/db/postgresql/migration/V20190530_1500__mantis14485.sql new file mode 100644 index 000000000..6d5217b8c --- /dev/null +++ b/src/db/postgresql/migration/V20190530_1500__mantis14485.sql @@ -0,0 +1,7 @@ +DO $$ +BEGIN + Insert into MOTIVO_CANCELACION (MOTIVOCANCELACION_ID,DESCMOTIVO,TIPOMOTIVO,EQUIVALENCIAELEKTRA_ID,EQUIVALENCIA_ID,ACTIVO,FECMODIF,USUARIO_ID,TXTRELATORIO,CVESISTEMA,INDEXIBECANCEL) + values ('94','REJEICAO SEFAZ','B',null,null,'1',SYSDATE,'1',null,'REJEICAO_SEFAZ',null); +END +$$; +