Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: getting error using Truncate Table option in DB2/Z

  1. #1

    Default getting error using Truncate Table option in DB2/Z

    I need to clear a table before writing to it using the Table Output step. Seems simple enough - just check the box. However I'm running DB2 9.1.5 for the Z and this option throws the syntax error:

    Couldn't execute SQL: ALTER TABLE mytablename ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE

    DB2 SQL error: SQLCODE: -199, SQLSTATE: 42601, SQLERRMC: ACTIVATE;ROTATE ADD RENAME APPEND VOLATILE AUDIT VALIDPROC CONSTRAINT

    I test the same exact transformation writing to DB2 9.7.1 LUW and it runs fine. The "alter table activate not logged initially with empty table" is a kind of tricky way to clear a table, but it looks like it doesn't work on the Z (like a lot of things). Is there a way to specify it to use a simple "TRUNCATE TABLE" command instead?

    I'm using 3.2.5

    Thanks!

    Dave

  2. #2
    Join Date
    Mar 2010
    Posts
    159

    Default

    Have you tried the job entry for truncating tables? It might do the same thing, not sure...

  3. #3
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    You can add a "Execute SQL Script" step to your transformation (no need to connect it to anything).
    In there you can run "DELETE from mytablename" and it will be executed prior to the execution of anything else in the transformation.

  4. #4

    Default

    Thanks. That worked fine. I'm still feeling my way around...

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.