ajthyng
ajthyng

Reputation: 1275

DB2 AS400 Triggers

I've been tasked with finding a way to migrate data into a DB2 AS400 database. When the data is entered (currently manually) on the front end, the system is doing some calculations and inserting the results in a table.

My understanding is that it's using a trigger to do so. I don't know very much about this stuff, but I have written code to directly insert values into that same table. Is there a way for me to figure out what trigger is being fired when users enter data manually?

I've looked in QSYS2/SYSTRIGGERS and besides not making much sense to me, I see no triggers that belong to the SCHEMA with my table in it.

Any help here would be awesome, as I am stuck.

Upvotes: 1

Views: 1054

Answers (1)

Charles
Charles

Reputation: 23793

SELECT *
FROM QSYS2.SYSTRIGGERS
WHERE TABSCHEMA = 'MYSCHEMA' 
      AND TABNAME = 'MYTABLE'

Should work fine.

If you'd prefer to use a 5250 command line, the Display File Description (DSPFD) command will show you the triggers on a file (table)

DSPFD FILE(MYSCHMA/MYTABLE) TYPE(*TRG)

Lastly, trigger information is available via the IBM i Navigator GUI. Either the older fat client version or the newer web based one.

Upvotes: 5

Related Questions