Is there any event based operations in Vertica?

Moderator: NorbertKrupa

Post Reply
jagadeesh
Newbie
Newbie
Posts: 21
Joined: Tue Feb 05, 2013 9:36 am

Is there any event based operations in Vertica?

Post by jagadeesh » Thu Feb 07, 2013 7:14 am

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.

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

Re: Is there any event based operations in Vertica?

Post by JimKnicely » Thu Feb 07, 2013 12:58 pm

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)
Jim Knicely

Image

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

jagadeesh
Newbie
Newbie
Posts: 21
Joined: Tue Feb 05, 2013 9:36 am

Re: Is there any event based operations in Vertica?

Post by jagadeesh » Tue Apr 16, 2013 7:27 am

Oh.. gr8... Thanks Jim..

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Is there any event based operations in Vertica?

Post by id10t » Tue Apr 16, 2013 9:46 am

Hi!

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

Post Reply

Return to “New to Vertica Database Development”