From 25c946c097ccd78d9f7ad1296930d5357363ce73 Mon Sep 17 00:00:00 2001 From: gleimar Date: Thu, 13 Oct 2016 15:08:30 +0000 Subject: [PATCH] fixes bug#8098 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@61547 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20161013_1159__mantis8098.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/db/migration/V20161013_1159__mantis8098.sql diff --git a/src/db/migration/V20161013_1159__mantis8098.sql b/src/db/migration/V20161013_1159__mantis8098.sql new file mode 100644 index 000000000..77eabb730 --- /dev/null +++ b/src/db/migration/V20161013_1159__mantis8098.sql @@ -0,0 +1,21 @@ +DECLARE + type namesarray IS VARRAY(13) OF VARCHAR2(20); + + names namesarray; + total integer; + existe integer; +BEGIN + names := namesarray('OCA', 'VISA', 'MASTERCARD', 'AMERICAN EXPRESS', 'CABAL', 'CREDITOS DIRECTOS','ANDA', 'CREDITEL', 'PASS CARD', 'DINERS', 'CLUB DEL ESTE', 'CTC', 'ASI'); + + total := names.count; + + FOR i in 1 .. total LOOP + select count(*) into existe from tarjeta_credito where DESCTARJETACREDITO = names(i); + if existe = 0 then + + INSERT INTO TARJETA_CREDITO (TARJETACREDITO_ID,DESCTARJETACREDITO,CANTMAXSINTASA,CANMAXCONTASA,TASA,ACTIVO,FECMODIF,USUARIO_ID) + VALUES (TARJETA_CREDITO_seq.nextval,names(i),1,1,1,1,sysdate,-1); + end if; + END LOOP; +END; +/ \ No newline at end of file