Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2012
    Posts
    5

    Question Unanswered: To view the structure of a database in DB2

    SELECT * FROM SYSIBM.SYSTABLES WHERE DBNAME ='dbname'

    This gives me the list of tables in that database


    SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME= 'tbname'

    This gives me details about the particular table

    I need to view all the tables and its structure like column name and length in a specific database..... I need a query to view the databse structure that contains all the tables along with the structure. Or is there any other way to view the schema structure of a databse....

    Thanks in advance.... Plz share your valuable inputs to solve this issue

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2012
    Posts
    5

    Thanks for ur reply... But I am working on DB2 on zOS and the scenario is to just view the structure of a database with out extracting the DDL statements.. and I cannot use any tools here...

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    that is the answer you get, if platform/version is not indicated from the start.
    create a script(rexx) that gets all tablenames from systables and selects all data from syscolumns needed by table....
    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
    http://www.infocura.be

Tags for this Thread

Posting Permissions

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