RE: Stupid Bind Variable question

2002-09-22 Thread Craig Munday
Title: RE: Stupid Bind Variable question





Hi,


I suggest the following:


- If a literal is always going to be the same value than it is marginal whether you use a bind variable for this.


- I'm not sure why you are using the to_char to_date functions? You should be able to create a bind variable of type date - hence you shouldn't need to worry about the format.

Cheers,
Craig.



-Original Message-
From: Alan Davey [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 21 September 2002 1:29 AM
To: Multiple recipients of list ORACLE-L
Subject: Stupid Bind Variable question



In any given SQL statement, do I need (or should I :^) ) create a bind variable for every literal value even if it is one of the following cases:

1) substring in a substr function 
2) date/time format mask used in to_char or to_date function
3) comparison value in a decode/case statement (not in the where clause)


I've seen it mentioned to use bind variables when comparing a column to a literal in the where clause, but nothing specific about the above scenarios. Basically what I am asking is, do all literals need to be made bind variables?

Thanks.
-- 


Alan Davey
[EMAIL PROTECTED]






-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Alan Davey
 INET: [EMAIL PROTECTED]


Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).





Re: Stupid Bind Variable question

2002-09-20 Thread Stephane Faroult

Alan Davey wrote:
 
 In any given SQL statement, do I need (or should I :^) ) create a bind variable for 
every literal value even if it is one of the following cases:
 
 1)  substring in a substr function
 2)  date/time format mask used in to_char or to_date function
 3)  comparison value in a decode/case statement (not in the where clause)
 
 I've seen it mentioned to use bind variables when comparing a column to a literal in 
the where clause, but nothing specific about the above scenarios.  Basically what I 
am asking is, do all literals need to be made bind variables?
 
 Thanks.
 --
 
 Alan Davey
 [EMAIL PROTECTED]
 

No. Bind variables are toa SQL statement what parameters are to a
procedure. If the value is always the same, you shouldn't use a bind
variable.

-- 
Regards,

Stephane Faroult
Oriole Software
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).