Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2005, 02:10 PM
Registered User
 
Join Date: Jan 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default bind variable

hi oracle lovers,
i want to know what is bind variable and how does it
improves query performence.
select ename from emp where empno= :num;
compiled
now i execute with by giving 7369 and i get the answer.
now i give 7444 ,i get the result ,but how does
oracle make it as soft parse instead of hard parse
while the two queries differ in the semantic structure.
select ename from emp where empno= 7369;
select ename from emp where empno=7444;

thr
 
Old February 15th, 2005, 05:32 AM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

See the example below,


-----LATE BINDING
declare
account_id VARCHAR(14) := 'CA6800003132';
begin
delete from sujit_test where account_id = account_id;
end;

---all the rows will be deleted


-----FAST BINDING
declare
account_id VARCHAR(14) := 'CA6800003132';
begin
EXECUTE IMMEDIATE 'delete from sujit_test where account_id = :1' USING account_id;
end;

---only that row(s) CA6800003132 will be deleted.


  In Late Binding the Value is assigned to the variable at the run-time whereas In Fast Binding the value is assigned at the compile time.

Sujit

Sujit Ku. Mahapatra





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
Bind a Label cp75 ASP.NET 1.0 and 1.1 Basics 19 January 10th, 2007 10:53 AM
Grid Bind msbsam ASP.NET 2.0 Basics 1 December 19th, 2006 07:03 AM
explain plan with bind variable ramanadyv SQL Language 0 March 2nd, 2006 05:06 AM
how to bind a data() lsxx Classic ASP Components 4 April 20th, 2005 02:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.