Reputation: 825
When executing this statement as script (f5)
DECLARE
COUNT_INDEXES INTEGER;
BEGIN
SELECT COUNT(*)
INTO COUNT_INDEXES
FROM USER_INDEXES
WHERE INDEX_NAME = 'NAME1' ;
IF COUNT_INDEXES > 0 THEN
EXECUTE IMMEDIATE 'DROP INDEX NAME1';
END IF;
END;
DECLARE
COUNT_INDEXES INTEGER;
BEGIN
SELECT COUNT(*)
INTO COUNT_INDEXES
FROM USER_INDEXES
WHERE INDEX_NAME = 'NAME2' ;
IF COUNT_INDEXES > 0 THEN
EXECUTE IMMEDIATE 'DROP INDEX NAME2';
END IF;
END;
I get an error message. But when I select the first one, execute it, then the second one and execute, it works flawlessly.
Is there a way to make this work when pressing f5?
Upvotes: 1
Views: 42
Reputation: 52356
For future ref, please mention the actual error message and the program you are using.
I suspect that you are missing a forward slash "/" between the two statements though.
Upvotes: 2