× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Luis,

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 one,
which can be done using correlations. I wonder if this is a bug?

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 missing?


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 shown
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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.