Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: 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 07:04.

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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/

  4. #4
    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

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •