Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2014
    Posts
    5

    Unanswered: I need to know if the table is used by any view

    Hi All



    I need to know if the table is used by any view ?

    because I need to rename table but I got this message

    RENAME TABLE X TO Y
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0750N The statement failed because the table or column cannot be renamed.
    SQLSTATE=42986

    when I search about this error I found that I need to drop any view or trigger related to this table before renaming..

    I use db2 v10 "Z linux"

    thank you very much

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    select tabschema,tabname from syscat.tabdep where bschema = 'MySchema' and bname - 'MyTable' and dtype = 'D' and btype = 'T'

    Andy

Posting Permissions

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