Oppolzer - Informatik / Blog


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

DB2-L - (Falsche) Apostrophe in SQL-Ergebnis

Subject:

DB2 V10 ZOS - apostrophe in SELECT output

From:

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

Reply-To:

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

Date:

2012.08.26 10:01:00


P.V. wrote:

In Reply to bernd oppolzer:

My guess: the EMPT_TABLE is a remote alias which points to a DB2 system
that resides on a machine which has another character set,
so the char x'7d' is translated to the } sign.


Not necessarily: it suffices that the encoding of EMPT_TABLE is UNICODE (or ASCII).

For example (e.g. in SPUFI):
SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSDUMMY1;
'   '   '  ,

While:
SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSTABLES FETCH FIRST ROW ONLY;
}   '   }  ,

Actually, DB2 10 now has three other "dummy" tables, each with an other encoding
(unicode, ascii, and ebcdic):

The following four queries return two times
'   '   '  ,
and two times
}   '   }  ,

SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSDUMMY1;
SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSDUMMYE;
SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSDUMMYU;
SELECT CHAR(X'7D') , CHAR(' '' ') , CHAR(X'7D') , CHAR(',')
FROM SYSIBM.SYSDUMMYA;

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