Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

TRUNCATE TABLE cannot run inside a BEGIN/COMMIT block

This is an error when I attempt to use the "Clear" option on a Netezza output table.
Exception in component tNetezzaOutput_1
org.netezza.util.PSQLException: ERROR: TRUNCATE TABLE cannot run inside a BEGIN/COMMIT block

I'm attempting to do a basic truncate/reload operation on a table.
I don't see any other options..... there should be a way to run some basic "truncate table foobar;" type SQL, right?
Ideas?
Thanks...
--Ivan
Labels (2)
4 Replies
Anonymous
Not applicable
Author

Hi Ivan,
"TRUNCATE" is a DDL command and can't be executed within a transaction. I don't know anything about your job or "Netezza". But you should ensure that you do not start a transaction before your command (or close an existing one).
Bye
Volker
Anonymous
Not applicable
Author

any workarounds for this.. running into similiar issue with version 3.1.1. what control can be used that is without tranaction scope for Neteezza
Anonymous
Not applicable
Author

Use the below approach as cautious workaround, make sure there are no transaction implications in the flow after this.
Have COMMIT before truncate statement like COMMIT; TRUNCATE TABLE xyz;
Anonymous
Not applicable
Author

Hi,
Try :-
EXECUTE IMMEDIATE 'TRUNCATE TABLE xyz;