30 lines
1.2 KiB
MySQL
30 lines
1.2 KiB
MySQL
declare
|
|
column_exists exception;
|
|
pragma exception_init (column_exists , -01430);
|
|
begin
|
|
execute immediate 'ALTER TABLE EMPRESA ADD (INDINTEGRACAOAGR NUMBER(1,0), SENHAINTEGRACAOAGR VARCHAR2(100))';
|
|
exception when column_exists then null;
|
|
end;
|
|
/
|
|
declare
|
|
column_exists exception;
|
|
pragma exception_init (column_exists , -01430);
|
|
begin
|
|
execute immediate 'ALTER TABLE CATEGORIA ADD INDINTEGRACAOAGR NUMBER(1,0)';
|
|
exception when column_exists then null;
|
|
end;
|
|
/
|
|
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 CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID)
|
|
VALUES (CONSTANTE_SEQ.nextval, ''URL_API_AGR'', ''URL DE ACESSO DA API DA AGR'', ''https://www.ouvidoria.agr.go.gov.br/gratuidadeservice/api/gratuidade/consultar-gratuidade?usuario=CNPJ' || '&' || 'senha=SENHAHASH'', ''1'', ''1'', ''1'', sysdate, ''1'')';
|
|
|
|
exception
|
|
when dup_val_on_index then null;
|
|
when except_02291 then null;
|
|
end; |