我写了一个程序块,如:
DECLARE
recCount pls_integer:=0;
idCounter pls_integer:=0;
BEGIN
SELECT COUNT(value) into recCount FROM classname_ WHERE value='CONNECT_BLOG_INTERPRETER';
SELECT MAX(classnameid)+1 into idCounter FROM classname_;
IF recCount = 0 THEN
INSERT INTO classname_ (classnameid, value) values (idCounter, 'CONNECT_BLOG_INTERPRETER');
DBMS_OUTPUT.PUT_LINE('Inserting Record CONNECT_BLOG_INTERPRETER');
ELSE
DBMS_OUTPUT.PUT_LINE('Record CONNECT_BLOG_INTERPRETER already exists.');
END IF;
END;
该语句执行没有任何问题,但是如果我希望使用它执行附加语句,例如:
select * from emp;
这给了我这样的错误:
Error report:
ORA-06550: line 14, column 1:
PLS-00103: Encountered the symbol "SELECT"
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
但现在,我需要这个一起工作。让我们考虑 DB-Patching 的情况,其中多个语句一个接一个地执行。
请指导我。