Re: Using parameter values in WHERE clause

From: Tom Green <bigband_at_preville.qc.ca>
Date: 4 May 2003 16:44:20 -0700
Message-ID: <c6f76a06.0305041544.634d15eb_at_posting.google.com>


tim.webster_at_bt.com (Tim) wrote in message news:<9ea6cfd9.0304300750.f3b8f2c_at_posting.google.com>...
> has anyone ever had a problem using a parameter value in a where
> clause, as opposed to a static string? I have an issue where if I use
> a parameter value, the clause seems to be ignored, while if I put in a
> static string, or assign the parameter to a local varible and use that
> instead, it works fine.
>
> If I print out the value of the parameter in my debugging log, it
> looks totally fine as well.
>
> Although there are easy workarounds for the problem, it's baffling me
> and I would like to know if anyone else has ever seen this. I
> certainly haven't in my roughly 4 years Oracle experience.
>
> Thanks



I don't know what you are using as a development language and how you are connecting to Oracle. I use VFP (Visual FoxPro) for my development.

You have to remember that when you send a select statement to Oracle, it knows nothing of your development evironment. All is knows is the string of characters it receives. In other words, if you want to put a varable in there, such as
  SELECT * FROM EMPLOYEE WHERE LASTNAME=?lcLastName you will need to write a little tool which looks for your parameter and converts the string to
  SELECT * FROM EMPLOYEE WHERE LASTNAME='JONES' (or whatever the last name requested is) before you send it off to the back end.

Tom Received on Mon May 05 2003 - 01:44:20 CEST

Original text of this message