Transactions

Moderator: NorbertKrupa

Post Reply
SQLTougherGuy
Newbie
Newbie
Posts: 1
Joined: Tue Apr 04, 2017 5:46 pm

Transactions

Post by SQLTougherGuy » Tue Apr 04, 2017 5:50 pm

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!

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1768
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Transactions

Post by JimKnicely » Thu Apr 06, 2017 4:40 am

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

Jim Knicely

Image

Note: I work for HPE. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “New to Vertica SQL”