If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Details of Views stored in DB2 9

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-07, 05:06
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Details of Views stored in DB2 9

Hi all,

In DB2 9.0 version, I executed the below query and found some junk values returned,

Code:
SELECT  TEXT FROM SYSCAT.VIEWS WHERE VIEWNAME LIKE 'MYVIEW';
The value returned is : 4352454154452056494557205650524F4A2020202041532053 454C45435420414C4C2050524F4A4E4F2C2050524F4A4E414D 452C20444550544E4F2C2052455350454D502C205052535441 46462C2050525354444154452C205052454E444154452C204D 414A50524F4A2046524F4D2050524F4A

But the view 'MYVIEW' , exists in the database.

Similarly the names, and the constraints of the defined table constraints is also not returned properly with the below queries,
Code:
SELECT CONSTNAME, TEXT  FROM SYSCAT.CHECKS WHERE TABNAME= 'SAMPLE_TABLE'

SELECT A.CONSTNAME, A.REFTABNAME, B.COLNAME FROM SYSCAT.TABCONST A, SYSCAT.KEYCOLUSE B WHERE  A.TABNAME = 'SAMPLE_TABLE'
Does the system tables to fetch the above metadata changed in DB2 9.0 ?

thanks,
Sn

Last edited by Shefu; 06-28-07 at 06:04.
Reply With Quote
  #2 (permalink)  
Old 06-29-07, 03:36
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
This looks to me as if you have some sort of issue with character encodings.

With which application do you issue your queries?
How was your database created?

p.s: Things work quite nicely for me on V9.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 07-01-07, 11:13
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by stolze
This looks to me as if you have some sort of issue with character encodings.
Indeed.
Interpreting the output as hex ASCII (or UNICODE) encoding, that output would read:
CREATE VIEW VPROJ AS SELECT ALL PROJNO, PROJNAME, DEPTNO, RESPEMP, PRSTAFF, PRSTDATE, PRENDATE, MAJPROJ FROM PROJ
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #4 (permalink)  
Old 07-02-07, 02:07
Shefu Shefu is offline
Registered User
 
Join Date: Apr 2005
Posts: 127
Dear Stolze and Peter,

Thanks for the reply. I dint have any problem in retrieving the TEXT of the other objects like Functions, Stored Procedures from the SYSCAT.ROUTINE table. Do you mean that the fetching from SYSCAT.VIEWS alone need this UNICODE wrapper.


BTW, I connect to my DB2 using JDBC from a Java application.

Regards,
Sn
Reply With Quote
  #5 (permalink)  
Old 07-02-07, 14:42
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I think that your application is not interpreting the string as string but rather as binary data.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On