Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: what is a bind variable?? (very newbie here)
Prabha Chidambaran <prabha_at_rcn.com> schreef in berichtnieuws
8e1vjr$40l$1_at_bob.news.rcn.net...
> hi all:
>
> I get errors sometimes in SQL saying"bad bind variable' and I am confused
by
> the book definitions. What exactly is a bind variable? Is it a bunch of
> fields "bound' to a variable??
> thanks so much,
> PC
>
>
Let's have the following pl/sql block
declare
p_empno number;
p_ename varchar2(30);
begin
select ename into p_ename
from emp
where empno = p_empno;
dbms_output.put_line(p_ename);
end;
/
p_empno is the bind variable.
The statement will be translated internally as
select ename
from emp
where empno = :b1
where b1 represents a pointer to p_empno.
Hth,
Sybrand Bakker, Oracle DBA Received on Mon Apr 24 2000 - 00:00:00 CDT
![]() |
![]() |