Page 1 of 1

Is there any event based operations in Vertica?

Posted: Thu Feb 07, 2013 7:14 am
by jagadeesh
Hi,

We have TRIGGERS in Oracle to handle the event based operations, Is there anything like that in Vertica?

I read somewhere that Vertica doesnt have a Programming Language capablities like PL/SQL... in this case how can we achieve Trigger functionality here.

Lets say i have a scenario that i am Inserting records through an ETL tool and i have to generate a Sequence number on the fly from Database...?
how can i achieve this?

looking for valuable inputs.

Thanks,
Jagadeesh.

Re: Is there any event based operations in Vertica?

Posted: Thu Feb 07, 2013 12:58 pm
by JimKnicely
Hi,

It is true that Vertica does not support triggers!
Lets say i have a scenario that i am Inserting records through an ETL tool and i have to generate a Sequence number on the fly from Database...?
how can i achieve this?
You do not need triggers to generate a sequence number in Vertica. You can use an IDENTITY column!

Example:

Code: Select all

dbadmin=> CREATE TABLE t (c1 IDENTITY, c2 VARCHAR(100));
CREATE TABLE
dbadmin=> INSERT INTO t (c2) VALUES ('Monday');
 OUTPUT
--------
      1
(1 row)

dbadmin=> INSERT INTO t (c2) VALUES ('Tuesday');
 OUTPUT
--------
      1
(1 row)

dbadmin=> INSERT INTO t (c2) VALUES ('Wednesday');
 OUTPUT
--------
      1
(1 row)

dbadmin=> SELECT c1, c2 FROM t ORDER BY c1;
 c1 |    c2
----+-----------
  1 | Monday
  2 | Tuesday
  3 | Wednesday
(3 rows)

Re: Is there any event based operations in Vertica?

Posted: Tue Apr 16, 2013 7:27 am
by jagadeesh
Oh.. gr8... Thanks Jim..

Re: Is there any event based operations in Vertica?

Posted: Tue Apr 16, 2013 9:46 am
by id10t
Hi!

IDENTITY is a bad solution, Vertica !CAN generate ANY functional sequence.