-
1. Re: how to take away the ' ' in the query statement?
davidjencks Oct 29, 2001 10:45 PM (in response to kttang)I have never come across a parameterized query handler that works with "in". I think it highly unlikely that your method can possibly work -- if C is an int(11), I would expect the database to want int(11) parameters.
You might try
C in ({0}, {1}, {2})
and when that doesn't work
C={0} or C={1} or C={2} which should work with any reasonable db. -
2. Re: how to take away the ' ' in the query statement?
abrasax Feb 14, 2002 5:21 AM (in response to kttang)I have the same problem...
Your solution is fine, but what when I don't know the number of the parameters? Do I really need to use BMP to solve that?
Regards
Martin -
3. Re: how to take away the ' ' in the query statement?
fiftefora Feb 20, 2002 5:22 PM (in response to kttang)Seems like there ought to be a way to trick jaws into
passing in the string without quotes. After all, it passes in Integers and things like that without quotes. I tried
making a finder with parameter type Object, but it still
added the quotes. :-(
Or: It seems like there ought to be some tricky thing you could do in MySQL with substrings and concatenation and such. But I don't yet see how to do it. However, I heard a rumor that there's a plan to make Perl the stored procedure language of MySQL. Then this kind of trick would definately be possible, it seems to me. Ugly, maybe, but possible.
(I basically didn't say anything, but on the chance that it would send someone off into finding the answer, I thought I'd post these musings....) -
4. Re: how to take away the ' ' in the query statement?
gigatoad Feb 28, 2002 10:52 AM (in response to kttang)I also agree that it would be very nice to make the ' ' optional in the query.
Where I would like to use it is in a case like this:
SELECT id from table WHERE myfield like {0} ORDER BY {1}
Where the {1} variable would be: upper(title) desc
That way I could do a case insensitive order by.
just my 2 cents... -
5. Re: how to take away the ' ' in the query statement?
dsundstrom Feb 28, 2002 1:58 PM (in response to kttang)This is the way JDBC works. The parameters are turned directly into a ? in a prepared statement.
Use dynamic-ql in JBossCMP if you want this feature.