Hi,
I got a strange problem while using ADODB with Access. In ruby, I use
the following SQL:
SELECT ID, SENDER FROM MESSAGE WHERE SENDER LIKE ‘Deals@deals-network.com’
it returned no records, while I use the same SQL in Access, it returned
2 records.
I changed the “SENDER LIKE” clause to “SENDER=”, it worked fine in Ruby.
Did anyway have the same problem? Maybe you can give me a hint if it is
an ADODB/Access bug, Ruby problem, or my problem…
Thanks!
Shannon
Hi,
I found out the reason:
if I use “%string%” instead of “string” it worked fine. I need to
check the SQL standard to see what is the standard character for
wildcards.
It definitely is a Microsoft problem, not ruby’s. Sorry for the noise.
Shannon
···
On Sun, 15 Dec 2002 22:16:28 +0900 Shannon Fang xrfang@hotmail.com wrote:
Hi,
I got a strange problem while using ADODB with Access. In ruby, I use
the following SQL:
SELECT ID, SENDER FROM MESSAGE WHERE SENDER LIKE ‘Deals@deals-network.com’
it returned no records, while I use the same SQL in Access, it returned
2 records.
I changed the “SENDER LIKE” clause to “SENDER=”, it worked fine in Ruby.
Did anyway have the same problem? Maybe you can give me a hint if it is
an ADODB/Access bug, Ruby problem, or my problem…
Thanks!
Shannon
% is the only SQL wildcard I’ve ever seen… I’d assumed (uhoh) that it was
standard.
···
if I use “%string%” instead of “string” it worked fine. I need to
check the SQL standard to see what is the standard character for
wildcards.
if I use “%string%” instead of “string” it worked fine. I need
to
check the SQL standard to see what is the standard character for
wildcards.
% is the only SQL wildcard I’ve ever seen… I’d assumed (uhoh)
that it was standard.
It is standard, but it’s not the only one. The two SQL wildcards
are:
% => .*
_ => .
Thus, “%string%” is the same as /.string./ and “str_ng” is the
same as /str.ng/.
-austin
– Austin Ziegler, austin@halostatue.ca on 2002.12.15 at 10.39.13
···
On Sun, 15 Dec 2002 23:38:42 +0900, Mike Campbell wrote:
I always thought it was “" :)) and Access do support "”, is it
Microsoft problem or mine?
···
On Sun, 15 Dec 2002 23:38:42 +0900 “Mike Campbell” michael_s_campbell@yahoo.com wrote:
% is the only SQL wildcard I’ve ever seen… I’d assumed (uhoh) that it was
standard.
Shannon Fang wrote:
% is the only SQL wildcard I’ve ever seen… I’d assumed (uhoh) that it was
standard.
I always thought it was “" :)) and Access do support "”, is it
Microsoft problem or mine?
Microsoft. The “*” looks like a hankering back to Visual Basic:
"These standard VB characters will also work in Access SQL statements.
However, notice that for SQL Server statements, you’ll need to use
different characters entirely. "
Or maybe it is part of their Evil "Embrace and Extend" plot!
···
On Sun, 15 Dec 2002 23:38:42 +0900 > “Mike Campbell” michael_s_campbell@yahoo.com wrote:
–
([ Kent Dahl ]/)_ ~ [ http://www.stud.ntnu.no/~kentda/ ]/~
))_student/(( _d L b_/ NTNU - graduate engineering - 5. year )
( __õ|õ// ) )Industrial economics and technological management(
_/ö____/ (_engineering.discipline=Computer::Technology)