익명의 pl/sql 블록에 커서와 함께 선언 된 프로 시저가 있습니다. 커서 앞에 프로 시저를 선언하면 실패합니다. 절차 이전에 커서를 선언해야한다는 요구 사항이 있습니까?익명 pl/sql 블록의 선언 순서
pl/sql 블록의 선언 순서에는 어떤 다른 규칙이 있습니까?
이 작동 :
DECLARE
cursor cur is select 1 from dual;
procedure foo as begin null; end foo;
BEGIN
null;
END;
이 PLS-00103: Encountered the symbol "CURSOR" when expecting one of the following: begin function package pragma procedure form
DECLARE
procedure foo as begin null; end foo;
cursor cur is select 1 from dual;
BEGIN
null;
END;
문서 참조입니다 여기 http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/block.htm#i32791 "항목 선언"(예 : 변수)이 목록에 있습니다. 1 "프로 시저/함수 정의"wh 앞에 와야합니다. ich는 목록 2에있다. –
@Gary : Excellent, thanks! –