Oppolzer - Informatik / Blog


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

DB2-L - DB2 V10: Vergleiche Zeichenketten mit numerisch (kein SQLCODE -401 mehr)

Subject:

SQLCODE = -401 in DB2 v10 CM09 for zOS

From:

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

Reply-To:

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

Date:

2013.11.16 18:46:00


even

SELECT *
FROM some_table
WHERE integer_column = '12345'

will now work in DB2 V10 NFM

When doing a DB2 class recently (with No-Techies,
no IT knowledge), I told them to put apostrophs around the constants
when comparing CHAR and DATE columns, and no apostrophs,
when comparing numeric data. But suddenly some of the participants
told me that he puts apostrophs everywhere, and it works.

I told them that this will cause some performance degradations,
but they didn't seem convinced ...

(maybe no performance problem in this simple case)

Kind regards

Bernd



Am 16.11.2013 17:35, schrieb D.S.:
> DB2 10 introduced this terrible wonderful thing called implicit
> casting. Your fixed char column is getting implicitly cast as varchar
> in NFM.
>
>
>
> -------- Original message --------
> From: P.G.
> Date: 11/16/2013 9:35 AM (GMT-06:00)
> To: DB2-L@lists.idug.org
> Subject: [DB2-L] - SQLCODE = -401 in DB2 v10 CM09 for zOS
>
>
> Greetings Listers !!
>
> I had a quick question regarding the data type compatibility in DB2
> for zOS v10 CM09.
>
> We have a sql where were are comparing VARCHAR (128) with CHAR(8)
> without any explicit casting. This SQL is working fine in DB2 V10 NFM
> which is there in UAT region, however in production we have DB2 V10
> CM09 and we are getting -401 error.
>
> Per Manual, this is incompatible data type. I wanted to know if you
> think we cannot compare VARCHAR with CHAR directly without any
> explicit casting in DB2 V10 CM09 ??
>
> Thanks,
>
> P.
>
>
> -----End Original Message-----

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