Odd SQL Search Behavior

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Feb 5 00:18:57 CST 2005


On 2/4/05 11:20 PM, "Chuck Pelto" <cbpelto at pcisys.net> wrote:

> So....
> 
> ...should I enclose the text, with spaces and/or hypens, in
> double-quotes (") or single-quotes (')?

Into single quotes

> And what if I'm using a variable? This was the case in my experienced
> problem. I had a variable that I was using that held the text I was
> looking for in the table.

In the SQL do not exists variable.
SQL this is just a string!

You need build string.
You must be able SEE it as string.

So do as

    cmd = "select ... WHERE fld = '" + str(var) + "'"


> Regards,
> 
> Chuck
> 
> On Feb 4, 2005, at 1:10 PM, Ruslan Zasukhin wrote:
> 
>> On 2/4/05 10:02 PM, "Chuck Pelto" <cbpelto at pcisys.net> wrote:
>> 
>>> Morning Ruslan,
>>> 
>>> Hope all is going well with you.
>>> 
>>> Please give me an example of "wrap value by '"'".
>> 
>> WHERE fld = 'text you search'

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina mailing list