|
I wonder...
OLD_TABLE is defined as available only with DELETE/UPDATE triggers. What
happens if you define one trigger containing OLD_TABLE as DELETE OR UPDATE
and another trigger (INSERT) with only the NEW_TABLE statement?
Regards,
Luis
Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--
On Tue, Jan 6, 2015 at 1:00 PM, Glenn Gundermann <
glenn.gundermann@xxxxxxxxx
wrote:
Hi Luis,one,
When specified as:
REFERENCING OLD AS oldtable
NEW AS newtable
it is implying:
REFERENCING OLD ROW AS oldtable
NEW ROW AS newtable
, which is used for defining a correlation.
I am trying to define transition tables.
What I have found through trial and error is that I can define an after
insert, update, or delete trigger using my syntax but not all three in
which can be done using correlations. I wonder if this is a bug?missing?
Example of code that completes successfully:
CREATE OR REPLACE TRIGGER hrithdrtrg_after_insert
AFTER INSERT ON ipithdr
REFERENCING NEW TABLE AS newtable
FOR EACH STATEMENT MODE DB2SQL
BEGIN
SIGNAL SQLSTATE '75000' ('Insert trigger');
END;
Yours truly,
Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144
On 6 January 2015 at 11:17, Luis Rodriguez <luisro58@xxxxxxxxx> wrote:
Glenn,
There is a slight syntax error (I think) in your code. The right syntax
should be:
REFERENCING OLD AS oldtable
NEW AS newtable
Just drop the "TABLE" after OLD and/or NEW
HTH,
Luis
Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--
On Tue, Jan 6, 2015 at 11:21 AM, Glenn Gundermann <
glenn.gundermann@xxxxxxxxx> wrote:
Hi Jim,
I have the same manual but I don't see your point. What am I
shown
Yours truly,
Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144
On 5 January 2015 at 22:48, Jim It <jim_it@xxxxxxxxxxx> wrote:
Trying again.
The only options for Referencing in CREATE TRIGGER statement are
below.
--+------------------------------------------------------------------+-->
.-------------------------------------------------. ||
| || V .-ROW-. .-AS-. (1)
'-REFERENCING----+-OLD--+-----+--+----+--correlation-name--+-----+-'
| .-ROW-. .-AS-. |
+-NEW--+-----+--+----+--correlation-name--+
| .-AS-. |
+-+-OLD TABLE-+--+----+--table-identifier-+
| '-OLD_TABLE-' |
| .-AS-. |
'-+-NEW TABLE-+--+----+--table-identifier-'
'-NEW_TABLE-'
Jim
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.