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.
Is there any event based operations in Vertica?
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Is there any event based operations in Vertica?
Hi,
It is true that Vertica does not support triggers!
Example:
It is true that Vertica does not support triggers!
You do not need triggers to generate a sequence number in Vertica. You can use an IDENTITY column!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?
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
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: Is there any event based operations in Vertica?
Oh.. gr8... Thanks Jim..
Re: Is there any event based operations in Vertica?
Hi!
IDENTITY is a bad solution, Vertica !CAN generate ANY functional sequence.
IDENTITY is a bad solution, Vertica !CAN generate ANY functional sequence.