Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: what is a bind variable?? (very newbie here)

Re: what is a bind variable?? (very newbie here)

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/04/24
Message-ID: <956597708.2558.0.pluto.d4ee154e@news.demon.nl>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US