Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

DB2-L - Fehler -104 durch Strichpunkt hinter SQL-Statement

Subject:

RE: DB2 ZOS (V10) vs DB2 LUW (V10)

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

DB2 List <db2-l@lists.idug.org>

Date:

2015.01.13 18:01:00


IMO, you should change the Java app.

I'm kind of surprised that DB2 on z/OS accepts the terminating semicolon;
I recall from older releases that this was not the case; when I did a dynamic
PREPARE and forgot to remove the semicolon, I got errors from DB2 on z/OS.

The semicolon is used by programs like SPUFI, DSNTEP2 and other tools (DB visualizer)
as a SQL statement separator, but it is not part of the SQL statement, and has
to be removed, before it is sent to DB2 using dynamic PREPARE; this is what
should be standard processing, no matter what host language you use.

HTH,
kind regards

Bernd



Am 13.01.2015 um 16:49 schrieb T.M.:
> We currently have a java application running on AIX, which connects to our
> DB2/ZOS (V10) database, using DB2/Connect V10.5.
>
> The SQL query within the Java App, has a semi-colon coded at the end as an end
> of statement.  This works fine when connecting to DB2/ZOS.
>
> However, when we attempt to have the app connect to a DB2/LUW (V10.5) database
> (on AIX), the app then fails with an SQLCODE -104 due to the semi-colon (If I
> remove the semi-colon, the app runs successfully against LUW)....
>
> Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -104,
> SQLSTATE: 42601, SQLERRMC: ;;LE_TYPE DESC WITH UR;END-OF-STATEMENT
>
> Is there a config setting in either DB2/Connect, Java, or LUW, that will allow
> LUW to accept the semi-colon (or to strip it before LUW gets it)?
>
> Thanks!
> T.M.
> DB2 Mainframe Dinosaur
>
> -----End Original Message-----

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie