隨着Oracle 10g的R2的回答是肯定的,有需要item_list_1項目之間的訂貨 和item_list_2,即使光標 定義被允許出來的地方。
例如一個過程定義是不是一個變量聲明之前,允許:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> declare
2 variable_declaration number;
3 procedure procedure_definition is begin
4 null;
5 end procedure_definition;
6 begin
7 null;
8 end;
9/
PL/SQL procedure successfully completed.
SQL> declare
2 procedure procedure_definition is begin
3 null;
4 end procedure_definition;
5 variable_declaration number;
6 begin
7 null;
8 end;
9/
variable_declaration number;
*
ERROR at line 5:
ORA-06550: line 5, column 5:
PLS-00103: Encountered the symbol "VARIABLE_DECLARATION" when expecting one of the following:
begin function package pragma procedure form
ORA-06550: line 8, column 4:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
end not pragma final instantiable order overriding static
member constructor map
這是11gR2嗎?我沒有11gR2的方便,它確實顯示你描述的是10gR2的行爲,匹配我答案中的錯誤信息。這也是10gR2文檔中描述的行爲:http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/block_declaration.htm#sthref2482 –
是的,那是在10gR2上。直到週一我將無法觸及11gR2。 –