fixes bug#AL-1536 qua: dev:Lucas

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@115121 d1611594-4594-4d17-8e1d-87c2c4800839
master
lucas.taia 2022-11-01 18:08:18 +00:00
parent 0fafa202ae
commit e1b4852ff0
2 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,14 @@ begin
exception when column_exists then null; exception when column_exists then null;
end; end;
/ /
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE BPE ADD (NUMDAV VARCHAR2(15) )';
exception when column_exists then null;
end;
/
declare declare
column_exists exception; column_exists exception;
pragma exception_init (column_exists , -01430); pragma exception_init (column_exists , -01430);
@ -39,7 +47,7 @@ BEGIN
FOR EMP IN (SELECT EMPRESA_ID FROM EMPRESA WHERE ACTIVO = 1 AND EMPRESA_ID > 0) FOR EMP IN (SELECT EMPRESA_ID FROM EMPRESA WHERE ACTIVO = 1 AND EMPRESA_ID > 0)
LOOP LOOP
BEGIN BEGIN
SELECT SEQUENCE_NAME INTO nomSeq from DBA_SEQUENCES where SEQUENCE_owner = (select user from dual) AND SEQUENCE_NAME like 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ%'; SELECT SEQUENCE_NAME INTO nomSeq from user_SEQUENCES where SEQUENCE_NAME like 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ%';
EXCEPTION WHEN NO_DATA_FOUND THEN EXCEPTION WHEN NO_DATA_FOUND THEN
EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE CYCLE'; EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE CYCLE';
END; END;

View File

@ -0,0 +1,7 @@
declare
column_exists exception;
pragma exception_init (column_exists , -01430);
begin
execute immediate 'ALTER TABLE BPE ADD (NUMDAV VARCHAR2(15) )';
exception when column_exists then null;
end;