View previous topic :: View next topic |
Author |
Message |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Jan 14, 2008 2:20 pm Post subject: Are the contents of SYSPACKSTMT in Unicode or EBCDIC? |
|
|
As of DB2 version 8, the contents of the SYSPACKSTMT (and the SYSSTMT) catalog tables could contain rows which are either UNICODE or EBCDIC characters, depending on when the package was last bound and which version of DB2 the package was bound under. A package bound under version 7 of DB2, when re-bound, will cause the contents of the STMT column on the SYSPACKSTMT table to be changed from EBCDIC to UNICODE.
My real question is:
Is there a way to determine whether the STMT column of the SYSPACKSTMT table contains UNICODE or EBCDIC characters without looking at the contents of the STMT column?
Is there some way to determine this by querying the system catalog or even within the contents of the STMT column itself? |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Jan 14, 2008 2:44 pm Post subject: |
|
|
I just got my answer from my DBA who went to IBM to get a response. It's fairly long, so I'll try to filter through the information and provide a readable post. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Jan 14, 2008 2:44 pm Post subject: |
|
|
jim haire,
Try this
Code: |
SELECT CAST(SUBSTR(T1.STMT,48,1) AS CHAR(1) CCSID EBCDIC
FOR SBCS DATA) AS DBRMMRIC,
CAST(SUBSTR(T1.STMT,47,1) AS CHAR(1) CCSID EBCDIC
FOR SBCS DATA) AS DBRMPDRM
FROM SYSIBM.SYSPACKSTMT T1, SYSIBM.SYSPACKAGE T2
WHERE T1.COLLID = 'EXAMPLE_COLLECTION'
AND T1.NAME = 'EXAMPLE_PACKAGE_NAME'
AND T1.COLLID = T2.COLLID
AND T1.NAME = T2.NAME
AND T2.TYPE = ' '
AND T1.SECTNO = 0
AND T1.SEQNO = 0
AND T1.STMTNO = 0;
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Jan 14, 2008 2:52 pm Post subject: |
|
|
Kolusu,
That is very similar to what I was sent. I will try both. Thanks for the quick response! |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Jan 14, 2008 3:18 pm Post subject: |
|
|
Based on the brief reading I've done and Kolusu's response, here is the additional information you need to look for.
If the DBRMMRIC (48th character of the STMT column) is less than or equal to "K",
the STMT column will be in EBCDIC.
If the DBRMMRIC (48th character of the STMT column) is equal to "L" and the DBRMPDRM (47th character of the STMT column) is also equal to "L", the STMT column will contain UNICODE characters. Otherwise, the STMT column will be in EBCDIC. |
|
Back to top |
|
|
|
|