当将此语句作为脚本执行时 (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;
我收到一条错误消息。但是当我选择第一个并执行它,然后选择第二个并执行时,它完美地工作。
有没有办法在按 f5 时完成这项工作?