Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2013

    Unanswered: sql error sql0964c sqlstate=57011

    hi everyone.. i have some problem with db2. i want to delete old data in table.
    i run this command to delete old file in table but sql error appear.

    db2 delete from reporttest where lastoccurrence < current timestamp - 60 days
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL0964C The transaction log for the database is full. SQLSTATE=57011

    i already increase size LOGFILSIZ 10000, LOGPRIMARY 20 and LOGSECOND 8

  2. #2
    Join Date
    Apr 2008
    Iasi, Romania
    Provided Answers: 3
    When you have a lot of rows to delete, you should delete in batches (e.g. 100 rows at a time then COMMIT).
    You may write a script, use a WHILE, and put somethink like:
    DELETE FROM your_table WHERE your_condition
    AND your_pk_field IN
    (SELECT your_pk_field FROM your_table FETCH FIRST 100 ROWS ONLY)
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Tags for this Thread

Posting Permissions

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