Hi All!
Just came across some interesting behavior while creating Raw Select
Queries in the modeler.
If my query looks like:
SELECT #result('count(*)' 'int' 'RECORDCOUNT')
FROM message JOIN user ON message.client_id = user.client_id
WHERE message.inbound = #bind($inboundStatus)
#if($userID)
AND user.client_id = #bind($userID)
#end
I get a SQLException as the new line character from the first to
second line is ignored and the SQL in the log looks like:
SELECT count(*) AS RECORDCOUNTFROM message JOIN user ON
message.client_id = user.client_id
WHERE message.inbound = ? AND user.client_id = ?]
However if I restructure the query in the modeler to:
SELECT #result('count(*)' 'int' 'RECORDCOUNT') FROM message JOIN user
ON message.client_id = user.client_id
WHERE message.inbound = #bind($inboundStatus)
#if($userID)
AND user.client_id = #bind($userID)
#end
i.e SELECT and FROM on the same line with a space before FROM, all is well?
Anyone else come across this?
Cheers,
garyj
This archive was generated by hypermail 2.0.0 : Tue Dec 26 2006 - 04:25:55 EST