I am wondering if you can point me in the right direction. I have spent the last little while trying to work out how to use Bind Variables in block code with declares. My issues is that every time I try run the code block in SQL Developer, its returning the error "Bind Variable "disp" is NOT DECLARED.
In a non-block piece of code I can get the results I am expecting. The following I know works and I do get results for:
var disp varchar2(200);
begin
test_procedure('test', 100, :disp);
end;
/
print :disp
The above code returns me a value, test100.
However, if I try move this into a block of code, that I could use as a single line in an external application (Java or PHP) I start running into trouble. What I have so far is:
declare
disp varchar2(200);
begin
test_procedure('test', 100, :disp);
end;
/
print :disp
When I run the above I am getting:
Bind Variable "disp" is NOT DECLARED
I have tried a few different approaches from using var inside the declare box to trying to reference the procedures variable definitions, however none are working for me