fixes bug#13369

dev:fabio
qua:Renato

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@89859 d1611594-4594-4d17-8e1d-87c2c4800839
master
aristides 2019-02-14 18:30:22 +00:00
parent e92cb1cfe3
commit cdb2acc4e1
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
--drop index se existe
DECLARE
itemExists NUMBER;
BEGIN
itemExists := 0;
SELECT COUNT(INDEX_NAME) INTO itemExists
FROM ALL_INDEXES
WHERE UPPER(INDEX_NAME) LIKE UPPER('PRECIO_VENTAJA__UN');
IF itemExists > 0 THEN
begin
EXECUTE IMMEDIATE 'drop index PRECIO_VENTAJA__UN';
EXECUTE IMMEDIATE 'ALTER TABLE PRECIO_VENTAJA ADD CONSTRAINT PRECIO_VENTAJA_PK PRIMARY KEY (PRECIOVENTAJA_ID )';
exception when others then null;
end;
END IF;
END;