Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    33

    Arrow Unanswered: SHOW View definition?

    Hi folks,

    is there a command which can show the definition of a view (i.e. show
    the actual SQL that created in the view)?

    much thanks
    ME

  2. #2
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    GUI or Shell ?

    Yes you can.

    If you are using a GUI interface (java)
    just rklick on the view, select change
    and rip off the creation code.

    On Unix/AIX/Linux you can use
    the db2look utility and specify
    the view as a table.

    BOW
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The db2look utiliy will produce DDL for a database, including views (with the -e option). See the Command Reference for information on the parms to use.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220
    What I meant is that
    the db2look utility treats
    views as tables, so use
    the -t <myview> switch
    to limit your output.
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  5. #5
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    SELECT TEXT
    FROM SYSCAT.VIEWS
    WHERE VIEWNAME = 'myview' and viewschema = 'myschema'
    --
    Jonathan Petruk
    DB2 Database Consultant

  6. #6
    Join Date
    Feb 2004
    Location
    Copenhagen
    Posts
    220

    Smile

    Nice one, hadn't seen that before!
    Kristian K. Hansen
    Project Supervisor
    National Board of Health

  7. #7
    Join Date
    Mar 2014
    Posts
    2

    View

    Hi,

    When i am trying to use this command to see the exact view SQL it is showing me as (Excluded)

    Please help

Posting Permissions

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