Can we use a bind variable in oracle inside a procedure or function ?
I\'m trying to update a bind variable inside my procedure. Can I do so in any case?
<
No, you cannot do what you are asking. Bind variables in plsql are handled transparently. You do not explicitly code bind variables unless you are going to use 'execute immediate' to run the code outside of plsql like this:
declare
v_bind number := 1;
begin
execute immediate 'select * from table where x = :v_bind';
end;`
The following code uses bind variables as well, but it is handled transparently by plsql:
declare
v_bind number := 1
y number;
begin
select count(*) into y from table where x = v_bind;
end;