Here is:
declare
v_str1 varchar2(80);
begin
v_str1 := 'test';
print :v_str1;
end
When I run it using SQLDeveloper just in a sql worksheet I get this:
Bind Variable "v_str1" is NOT DECLARED
anonymous block completed
Here is:
declare
v_str1 varchar2(80);
begin
v_str1 := 'test';
print :v_str1;
end
When I run it using SQLDeveloper just in a sql worksheet I get this:
Bind Variable "v_str1" is NOT DECLARED
anonymous block completed
Try
declare
v_str1 varchar2(80);
begin
v_str1 := 'test';
print v_str1;
end
Got it:
set serveroutput on
declare
v_str1 varchar2(80);
begin
v_str1 := 'test';
dbms_output.put_line(v_str1);
end;
print is not a PLSQL function. if you want to get an out put , you can use dbms_output.put_line(v_str1);
set serveroutput on;
declare v_str1 varchar2(80); begin v_str1 := 'test'; dbms_output.put_line(v_str1); end;
:v_str1 is a bind variable but you must declare not in a plsql. When you declare it you must use VARIABLE keyword.