JR37942: TRUNCATE TABLE STATEMENT IS NOT SUPPORTED AS A USER DEFINED TRUNCATE STATEMENT IN DB2 COMMON CONNECTOR FOR DB2 9.7
Closed as program error.
Job with DB2 Common Connector failed when TRUNCATE TABLE statement was used for the user defined truncate statement. Error message in job log was: Item #: 41 Event ID: 407 Timestamp: 2010-09-14 16:22:16 Type: Info User Name: dsadm Message Id: IIS-CONN-DB2-00695 Message: DB2_Connector_10: DB2 reported: SQLSTATE = 25001: Native Error Code = -428: Msg = [IBM][CLI Driver][DB2/AIX64] SQL0428N The SQL statement is only allowed as the first statement in a unit of work. SQLSTATE=25001 Item #: 42 Event ID: 408 Timestamp: 2010-09-14 16:22:16 Type: Fatal User Name: dsadm Message Id: IIS-CONN-DB2-00028 Message: main_program: Fatal Error: An error occurred when truncating the table. Statement = TRUNCATE TABLE KSJ.TEST1 IMMEDIATE
Use Generated truncate statement or use "ALTER TABLE tablename ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE" or "CALL SYSPROC.ADMIN_CMD('IMPORT FROM /dev/null OF DEL REPLACE INTO tablename')" as the user defined truncate statement.
If the user set the DB2Connector's Table action property to Truncate and supplied a user-defined TRUNCATE TABLE statement, the job failed with the following error: DB2 reported: SQLSTATE = 25001: Native Error Code = -428: Msg = [IBM][CLI Driver][DB2/AIX64] SQL0428N The SQL statement is onlyallowed as the first statement in a unit of work. SQLSTATE=25001
DB2 9.7 introduced a TRUNCATE TABLE statement, but it must be the first statement in the transaction. If the user supplies a truncate statement, the DB2 Connector now commits the current transaction before executing the TRUNCATE TABLE statement.
Reported component name
Reported component ID
Last modified date
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fixed component name
Fixed component ID
Applicable component levels