SQL> Declare 2 Ldate date; 3 Begin 4 Ldate := '29-SEP-2005'; 5 dbms_output.putline (Ldate); 6 End; 7 / dbms_output.putline (Ldate); * ERROR at line 5: ORA-06550: line 5, column 14: PLS-00302: component 'PUTLINE' must be declared ORA-06550: line 5, column 2: PL/SQL: Statement ignored SQL> Declare 2 L_start_date date; 3 Begin 4 L_start_date := '23-MAY-2009'; 5 dbms_output.put_line(L_start_date); 6 end; 7 / 23-MAY-09 PL/SQL procedure successfully completed. SQL>
出错的原因是:dbms_output.putline(); 函数名在新版本中变了。
应该是:dbms_output.put_line();
改正后就好了。