Results 1 to 5 of 5

Thread: SYSCAT tables

  1. #1
    Join Date
    May 2012

    Unanswered: SYSCAT tables

    Hallo everyone,

    I tried this code:

    select distinct count(tabschema) from syscat.tables;

    On CLP, it gave me 2676

    But in my database client, there are only 2423

    Why are they not the same amount?

    Thank you.


  2. #2
    Join Date
    Apr 2006
    Provided Answers: 11
    have you executed the same query - or executed by gui ....
    maybe they add some predicate to filter some table,alias......
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

  3. #3
    Join Date
    May 2012
    I run the following:

    select status from syscat.tables where tabname='${TAB}' and tabschema='${SCHEMA}'

    on the database client I run, it gave me 0 result.

    on CLP, it gave me STATUS = N

  4. #4
    Join Date
    Jan 2007
    Jena, Germany
    Why do you use DISTINCT here? After all, the COUNT() produces only a single row and there can hardly be duplicates.

    Regarding the differences, I suggest that you have a look at the content of ${TAB} and ${SCHEMA} to make sure no strange characters are in there, which cause a change to the predicates being evaluated and, thus, give you SQL injection errors.

    Another thought is that you are connecting to a different database and/or a different server, maybe? Depending on the API you use to connect to DB2, you may want to collect a trace...
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    May 2012
    okay, thank you guys, I will check.

Posting Permissions

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