Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Create trigger
Tue, May 27 2008 5:37 AMPermanent Link

Francisco Fernandez
Hi, i'm triying elevatedb and i want to create a sample trigger. I have a Database called
"Tutorial" with two tables "CUSTOMERS" and "DATOS" i try to create this trigger before
insert "CUSTOMERS" by ElevateDB Manager:

BEGIN
 UPDATE DATOS
 SET CONTADOR=CONTADOR+1;
END

CONTADOR is a field of DATOS table that i want to increase when i add a register in the
table "CUSTOMERS" but it gives me the error:

"Invalid expresion DATOS found, the referenced cursor does not exist"

Can you help me?

Thank you
Tue, May 27 2008 6:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francisco


Try this

BEGIN
EXECUTE IMMEDIATE ' UPDATE DATOS SET CONTADOR=CONTADOR+1';
END

Roy Lambert [Team Elevate]
Tue, May 27 2008 8:07 AMPermanent Link

Francisco Fernandez
Thank you for your fast response.

Where can i find examples of triggers to see sintaxis?

Francisco
Tue, May 27 2008 8:24 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francisco


Look at

Chapter 7
SQL/PSM Statements

in the edb1sql.pdf. That's about as good as you'll get.

Roy Lambert
Image