Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004

    Unanswered: can {oj be used in query? gives syntax error

    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 tion(Unknown Source

    i removed the white spaces and i also have the correct driver, what can i do?


  2. #2
    Join Date
    Jul 2003
    The Dark Planet
    {oj ... what does it exactly mean ???
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Jan 2004
    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

  4. #4
    Join Date
    Feb 2004
    {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.

  5. #5
    Join Date
    Jan 2004
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts