Results 1 to 2 of 2

Thread: Deleting tables

  1. #1
    Join Date
    Oct 2002
    Location
    chennai
    Posts
    30

    Question Unanswered: Deleting tables

    Hi all,

    Can any one tell me the query which can delete the tables which start with the same name. I mean, if T1, T2, T3, T4, T5.......Tn are the table names. How to delete all these tables with a single query.
    Thanks,
    sekhar rao k

  2. #2
    Join Date
    Feb 2003
    Posts
    22
    you cannot drop them in a single query, but you can build all the delete statemets using sysibm.systables
    like this

    SELECT 'DELETE FROM'!!NAME!!'WHERE 1=1; COMMIT;' FROM
    SYSIBM.SYSTABLES
    WHERE NAME LIKE 'T%'

    Hope it was what you need....
    Cristiana
    Data Base Administrator
    Bologna
    Italy

Posting Permissions

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