ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Nabours <manabo...@yahoo.com>
Subject SQL Help -- Escape $ in case expression
Date Tue, 28 Dec 2004 03:39:17 GMT
Hello!

I have a case expression in my SQL query similar to
the following:

sum(case when code = 'tck$' then amount else 0 end) as
ticketSales

When the case expression is written like that, I
receive a
com.ibatis.common.jdbc.exception.NestedSQLException.

I changed the case expression to the following and it
works just fine:

sum(case when code like 'tck%' then amount else 0 end)
as ticketSales

Is there a way to escape the $ in my SQL query so that
it won't cause a
com.ibatis.common.jdbc.exception.NestedSQLException?

Or in general how do you escape characters in your SQL
query that have special meaning in iBatis (like the
#)?

Thanks,
Mark


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

Mime
View raw message