× 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.



I did this:

STRSQL

CREATE TABLE COMPANY_STATS 
      (NBEMP INTEGER, 
       NBPRODUCT INTEGER, 
       REVENUE DECIMAL(15,0))

INSERT INTO ROB/COMPANY_STATS (NBEMP) VALUES(1)

CREATE TABLE ROB/EMPLOYEE (EMPNBR INT NOT NULL WITH DEFAULT)

CREATE TRIGGER NEW_HIRE 
      AFTER INSERT ON EMPLOYEE 
      FOR EACH ROW MODE DB2SQL 
        UPDATE COMPANY_STATS SET NBEMP = NBEMP + 1

INSERT INTO ROB/EMPLOYEE (EMPNBR) VALUES(5)

SELECT * FROM COMPANY_STATS
....+....1....+....2....+....3....+....4....+....5..
        NBEMP       NBPRODUCT               REVENUE 
            2                -                     -
********  End of data  ******** 

CREATE COLLECTION ROBX


F3

SAVOBJ OBJ(COMPA00001 EMPLOYEE) LIB(ROB) DEV(*SAVF) SAVF(ROB/ROB)

RSTOBJ *ALL ROB DEV(*SAVF) SAVF(ROB/ROB) RSTLIB(ROBX)

DSPFD ROBX/EMPLOYEE 

.+....1....+....2....+....3....+....4....+....5....+....6....+....7
Trigger name  . . . . . . . . . . . . . . . : TRG        NEW_HIRE 
  Trigger library . . . . . . . . . . . . . :            ROBX 
  Trigger state . . . . . . . . . . . . . . : STATE      *ENABLED 
  Trigger status  . . . . . . . . . . . . . :            *OPERATIVE


STRSQL

INSERT INTO ROBX/EMPLOYEE (EMPNBR) VALUES(7)

SELECT * FROM ROBX/COMPANY_STATS 
....+....1....+....2....+....3....+....4....+....5..
        NBEMP       NBPRODUCT               REVENUE 
            2                -                     -
********  End of data  ******** 

SELECT * FROM ROB/COMPANY_STATS
....+....1....+....2....+....3....+....4....+....5..
        NBEMP       NBPRODUCT               REVENUE 
            3                -                     -
********  End of data  ******** 

However, ROB is in my library list and ROBX is not.

But basically the trigger stayed operative.  Which, based on the previous 
discussion, I didn't think it would.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.