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

Home -> Community -> Usenet -> c.d.o.server -> Re: VARCHAR2(1) vs CHAR(1)

Re: VARCHAR2(1) vs CHAR(1)

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 29 Jul 2002 00:25:11 +0200
Message-ID: <phr8kuo9gmendh7kgej4p78mhl2a066r2u@4ax.com>


On Sun, 28 Jul 2002 23:50:38 +0200, "Stjepan Brbot" <stjepan.brbot_at_zg.hinet.hr> wrote:

>Sorry! Although it is probably newbie question, but I will not hesitate
>to ask; what are bind variables? or what you assume under term bind
>variable?

alter session set sql_trace = true;
declare
p_empno number;
p_ename varchar2(32);
begin
/* statement using bind variables. The statement will be parsed only once, there is one statement parsed.
*/
p_empno := 10;
select ename
into p_ename
from emp
where empno = p_empno;
p_empno := 20;
select ename
into p_ename
from emp
where empno = p_empno;

/*statements not using bind variables. As the hash value of the statement is different, there are now 2 different statements which will be parsed both */

select ename
into p_ename
from emp
where empno = 10;

select ename
into p_ename
from emp
where empno = 20;
end;
/

Now run tkprof on the resulting trace file and you will see what is the difference.

Hth

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Sun Jul 28 2002 - 17:25:11 CDT

Original text of this message

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