
Signature
Roy
UK Ingres User Association Conference 2009 will be on Tuesday June 9, 2009
Go to http://www.iua.org.uk/join to get on the mailing list.
I have looked at the original Ingres paper work that relates to BEFORE
triggers and there is nothing that I can see that says that you cannot
execute INSERT, UPDATE or DELETE statements from a BEFORE trigger, there
was reference to the SQL standard, I have trawled through the relevant
parts and have found the following statement:
If the trigger is a BEFORE trigger and if, before the completion of the
execution of any <SQL procedure statement> simply contained in triggered
SQL statements, an attempt is made to execute an SQL-data change
statement or an SQL-invoked routine that possibly modifies SQL-data,
then an exception condition is raised: prohibited statement encountered
during trigger execution.
John
-----Original Message-----
From: info-ingres-bounces@kettleriverconsulting.com
[mailto:info-ingres-bounces@kettleriverconsulting.com] On Behalf Of Roy
Hann
Sent: 29 July 2008 17:46
To: info-ingres@kettleriverconsulting.com
Subject: Re: [Info-Ingres] BEFORE Rules and Data Change statements
John Smedley wrote:
> Martin is correct if a BEFORE RULE is CREATED that executes a DATABSE
> PROCEDURE that contains an INSERT, UPDATE OR DELETE, the following
> message is generated when the CREATE RULE statement is executed:
> E_US18B5 CREATE RULE: Data change statements are not permitted in
> Procedures triggered by BEFORE rules.
> Being of devious mind, I created a second PROCEDURE which contains my
> DML that is called from the first, and low and behold the RULE creates.
> When the rule is fired, there are no run time errors.
> BUT I have not checked for side effects or other nastiness.
I hope I would do the same thing you did. :-) But even now that Marty's
alerted me to the limitation I can't think of a good reason for it. It
is not ever a physical error to attempt to update a non-existent row, so
that couldn't be the reason.
Someone out there knows.

Signature
Roy
UK Ingres User Association Conference 2009 will be on Tuesday June 9,
2009
Go to http://www.iua.org.uk/join to get on the mailing list.
_______________________________________________
Info-Ingres mailing list
Info-Ingres@kettleriverconsulting.com
http://www.kettleriverconsulting.com/mailman/listinfo/info-ingres