declare column_exists exception; pragma exception_init (column_exists , -01430); begin execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD EMPRESA_ID NUMBER(7,0)'; exception when column_exists then null; end; / declare dup_val_on_index exception; except_02275 exception; pragma exception_init (dup_val_on_index , -01430); pragma exception_init (except_02275 , -02275); begin execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD CONSTRAINT FK_CONF_REST_CV_EMPRESA FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA(EMPRESA_ID)'; exception when dup_val_on_index then null; when except_02275 then null; end; / declare column_exists exception; pragma exception_init (column_exists , -01430); begin execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECINICIOVIGENCIA DATE'; exception when column_exists then null; end; / declare column_exists exception; pragma exception_init (column_exists , -01430); begin execute immediate 'ALTER TABLE CONF_RESTRICAO_CANALVENTA ADD FECFINVIGENCIA DATE'; exception when column_exists then null; end;