Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Unanswered: Query working with CLI Native driver giving error with JDBC Type 4 Universal Driver

    While executing some queries using DB2 JDBC Type 4 Universal driver in java application, the following error is thrown

    Code:
    DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: ;;) + CURRENT TIMEZONE;END-OF-STATEMENT
    The sql query is as below

    Code:
    delete from ice.right_column	 where rc_id = 'pm025491' and rc_launch_date = TIMESTAMP('2006-11-23-05.01.00') + CURRENT TIMEZONE;
    The query was working fine with DB2 CLI Native driver, but on porting the application to JDBC Type 4 Universal driver, the above error is coming up.
    The error is because of trailing semicolon, removing which removes the error.

    But our application is such that modifying queries will involve a lengthy process (i.e the queries are generated by some other application), is there a way of configuring the Type 4 driver (specifying/despecifying statement delimiter...etc) so that it stops complaining !!!.

    And if someone can throw some light(i.e any DB2 developers ??) as to the core reason why Type 4 driver is complaining, bearing in mind that the CLI driver has no issues with it.

    Thanks in advance !!.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The ';' is not part of the SQL statement. Just remove it.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    Thanks stolze, but as I mentioned removing them will be very cumbersome in my case.....so am looking for alternatives. Don't you think an alternative solution should be there bearing in mind that the CLI driver had no issues with the trailing semicolon and that ; acts as statement delimiter in DB2

Posting Permissions

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