put_line上的语法错误

时间:2011-11-16 17:55:35

标签: oracle plsql

我正在做一项任务,并且正在努力让它发挥作用:

declare sal number;
begin
sal := 1;
select min_salary into sal from jobs where job_ID = 'ad_vp';
dbms_output put_line('value is' || sal);
end;

如果这是mssql,我永远不会问这个,但我的学习在本学期使用oracle。为什么我会收到此错误消息,如何避免它?

> ORA-06550: line 5, column 13: PLS-00103: Encountered the symbol
> "PUT_LINE" when expecting one of the following:
> 
>    := . ( @ % ; The symbol ":=" was substituted for "PUT_LINE" to
> continue.
> 3. sal := 1;
> 4. select min_salary into sal from jobs where job_ID = 'ad_vp';
> 5. dbms_output put_line('value is' || sal);
> 6. end;

1 个答案:

答案 0 :(得分:2)

你错过了一个点,它应该是:

dbms_output.put_line('value is' || sal);