Page 1 of 1

Transactions

Posted: Tue Apr 04, 2017 5:50 pm
by SQLTougherGuy
Hello,

I am trying to get some information about Vertica Transactions. I ran a few Google searches and the only syntax that I found was using the ADO.NET object to create them.

Is there a way to write Vertica Transaction similar to the way it is done in SQL and/or Oracle? Or do I have to use the ADO.NET object?

Something like this...

CREATE TRANSACTION test
BEGIN TRAN
SELECT * FROM table
END TRAN
COMMIT;

Thank you!

Re: Transactions

Posted: Thu Apr 06, 2017 4:40 am
by JimKnicely
Hi,

Vertica supports conventional SQL transactions with ANSI SQL 92 style-implicit transactions. You do not need to run a BEGIN or START TRANSACTION command.

However, you can...

START TRANSACTION:
https://my.vertica.com/docs/8.0.x/HTML/ ... ACTION.htm

END/COMMIT:
https://my.vertica.com/docs/8.0.x/HTML/ ... ts/END.htm
https://my.vertica.com/docs/8.0.x/HTML/ ... COMMIT.htm

Example:

dbadmin=> begin transaction;
BEGIN

dbadmin=> select * from dual;
dummy
-------
X
(1 row)

dbadmin=> end;
COMMIT