What is wrong with this PL/SQL? Bind Variable * is NOT DECLARED(这个 PL/SQL 有什么问题?绑定变量 * 未声明)

本文介绍了这个 PL/SQL 有什么问题?绑定变量 * 未声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是:

declare
  v_str1   varchar2(80);
begin
  v_str1 := 'test';
  print :v_str1;
end

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

When I run it using SQLDeveloper just in a sql worksheet I get this:

Bind Variable "v_str1" is NOT DECLARED
anonymous block completed

推荐答案

明白了:

set serveroutput on

declare
  v_str1   varchar2(80);    
begin
 v_str1 := 'test';
 dbms_output.put_line(v_str1);
end;

更多信息在这里.

这篇关于这个 PL/SQL 有什么问题?绑定变量 * 未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!