[resolved] How do I turn transactions off when using a tPostgresqlRow?

One Star

[resolved] How do I turn transactions off when using a tPostgresqlRow?

am trying to design a drop-create database job for postgres engine but it spit my face with the message "DROP DATABASE cannot run inside a transaction block".I use a workaround placing an END; and BEGIN statements before and after the drop and create statements like this
"END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;
BEGIN;"
But beside being ugly, the BEGIN start a new transaction at the end of my statement and it is going to be successful making my component return ok even when the statement fails and the runIf trigger connector doesn´t works correctly
HOW I DEACTIVATE TRANSACTIONS FOR THE tPostgresqlRow COMPONENT? THERE MOST BE A CHECKBOX OR SOMETHING FOR THIS MATTER!

Accepted Solutions
One Star

Re: [resolved] How do I turn transactions off when using a tPostgresqlRow?

Well I fix the problem just adding the END sentence at the begining but ignoring the BEGIN sentence at the end of the query. It works perfectly
i.e.
END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;

All Replies
One Star

Re: [resolved] How do I turn transactions off when using a tPostgresqlRow?

Well I fix the problem just adding the END sentence at the begining but ignoring the BEGIN sentence at the end of the query. It works perfectly
i.e.
END;
CREATE DATABASE aNewDb
WITH OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default;