Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Posts
    177

    Unanswered: Need to truncate all the tables using the script

    Hi all,

    In our setup db2V9.7 using fixpack 4

    Need help for truncate all the tables under the schema..

    If it is possible to truncate all the tables using the script?

    Thanks,
    laxman..

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    EXPORT TO
    TruncateScript.sql
    OF DEL
    MODIFIED BY nochardel
    SELECT 'TRUNCATE TABLE ' || TRIM(TABSCHEMA) || '.' || TRIM(TABNAME) || ' REUSE STORAGE IMMEDIATE;'
    FROM SYSCAT.TABLES
    WHERE TYPE = 'T'

    Then run TruncateScript.sql
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Posting Permissions

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