这个PL/SQL有什么问题?绑定变量*未声明

Nit*_*xDM 12 oracle variables plsql

这是:

declare
  v_str1   varchar2(80);
begin
  v_str1 := 'test';
  print :v_str1;
end
Run Code Online (Sandbox Code Playgroud)

当我在SQL工作表中使用SQLDeveloper运行它时,我得到了这个:

Bind Variable "v_str1" is NOT DECLARED
anonymous block completed
Run Code Online (Sandbox Code Playgroud)

Nit*_*xDM 5

得到它了:

set serveroutput on

declare
  v_str1   varchar2(80);    
begin
 v_str1 := 'test';
 dbms_output.put_line(v_str1);
end;
Run Code Online (Sandbox Code Playgroud)

更多信息在这里.