Hi all
i am using a query
SELECT DISTINCT lcactivityT.activitycategory_id, code, sort_order, description, lccategoryT.code_alias, lccategoryT.description_alias FROM
{oj ActivityCategory AS categoryT INNER JOIN LicensedClientActivities AS lcactivityT ON lcactivityT.activitycategory_id = categoryT.activitycategory_id LEFT OUTER JOIN LicensedClientCategories AS lccategoryT ON categoryT.activitycategory_id = lccategoryT.activitycategory_id AND lccategoryT.licensedclient_id = '1'}
WHERE lcactivityT.licensedclient_id = '1'
This works fine in mssql query analyser but when i use it in code, using mssql jdbc driver, i am getting following error
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Syntax error a
t token ON , line 0 offset 84.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Source
......
i removed the white spaces and i also have the correct driver, what can i do?
Thanku{oj ... what does it exactly mean ?|||as far as i know {oj is a way to tell JDBC driver that we are using OUTER JOIN in the following, we can remove it if we want to but, we have whole lot of queries using it, previously we were using different server and driver, and now different server and driver and so throwing me the error. Any way to get rid of that|||{oj is an ODBC escape sequence to support outer joins (either left, right or full). Perhaps this driver has more difficulty understanding what to do with it, so removing it
might help. As for the outer/inner joins: placing parenthesis around the search conditions may help as well.|||hi all
Thanx for the reply, the problem got solved i just downloaded new microsoft mssql jdbc driver, and it recognized the syntax and its working fine now
Sunday, February 12, 2012
can {oj be used in query? gives syntax error
Labels:
activitycategory_id,
alli,
code,
code_alias,
database,
description,
distinct,
error,
lcactivityt,
lccategoryt,
microsoft,
mysql,
oracle,
query,
queryselect,
server,
sort_order,
sql,
syntax
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment