hi friends,

The trigger i used is as follows:
-----------------------------------------------------------------------------------------
CREATE TRIGGER AFTER_SALARY
AFTER UPDATE OF SALARY ON EMPLOYEE
REFERENCING NEW_TABLE AS NEWSALARY OLD_TABLE AS OLDSALARY
FOR EACH STATEMENT MODE DB2SQL
BEGIN ATOMIC
FOR SALARY_CUR AS
Select N.SALARY, O.SALARY
from NEWSALARY N INNER JOIN OLDSALARY O ON (N.EMPNO=O.EMPNO)
DO
--SET SALARY_CUR.NS = SALARY_CUR.OS;
END FOR;
END
@
-----------------------------------------------------------------------------------------

The error produced is :
-----------------------------------------------------------------------------------------
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0783N A duplicate column name or unnamed column was specified in a DECLARE
CURSOR statement of a FOR statement. LINE NUMBER=10. SQLSTATE=42738
-----------------------------------------------------------------------------------------

Once I've put the alias names for N.SALARY and O.SALARY in the select statement, the trigger is created successfully.
I couldn't understand the behavior. Can anyone explain me?

Jake