Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2007
    Posts
    62

    Unanswered: Distinguish between table and view in db2 ?

    Hi,

    I just have name of the object which is table or view.
    How to know which one it is ?

    thanks
    Vilius

  2. #2
    Join Date
    Apr 2008
    Posts
    39
    SYSIBM.SYSTABLES catalog table has a type column where you can check whether the object is of type table or view.

    SELECT name, type from sysibm.systables where name='object name'

    Gives whether the "name" object is of type table or view or alias.

    Type of objects are
    A - Alias
    T - Table
    V - View

    For more info you can refer to
    http://publib.boulder.ibm.com/infoce...ablestable.htm

    Thanks,
    Madhavi.

  3. #3
    Join Date
    Apr 2008
    Posts
    39
    SYSIBM.SYSTABLES catalog table has a type column where you can check whether the object is of type table or view.

    SELECT name, type from sysibm.systables where name='object name'

    Gives whether the "name" object is of type table or view or alias.

    Type of objects are
    A - Alias
    T - Table
    V - View

    For more info you can refer to
    http://publib.boulder.ibm.com/infoce...ablestable.htm

    Thanks,
    Madhavi.

  4. #4
    Join Date
    May 2007
    Location
    somewhere in dbforums
    Posts
    221
    if type of object is N - then it means it is a nickname which is used in case of federated databases.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Nicknames exist in DB2 LUW and there you query SYSCAT.TABLES. The tables in the SYSIBM schema are not documented (except SYSIBM.SYSDUMMY1) and relying on them in DB2 LUW is like begging for problems.
    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
  •