0 pts.
 triggers
i know you can attach a trigger to a physical file, but can you attach one to a print file or even a display file. thanks in advance

Software/Hardware used:
ASKED: February 3, 2006  12:11 PM
UPDATED: November 26, 2009  7:38 AM
  Help
 Approved Answer - Chosen by TomLiotta

I'm a little confused - the QTEMP library is just that, a temporary library, so any files in it are surely only being used as work files for the current job. As soon as the job completes, the contents of the QTEMP library will be removed.

Having said that, there is no reason why you cannot add a trigger to a file in QTEMP the same as you can to any database file in any library.

The following worked on my box:

ADDPFTRG FILE(QTEMP/SADP006A)
TRGTIME(*BEFORE)
TRGEVENT(*UPDATE)
PGM(QGPL/TRGR001A)

The only prerequisites being that a) the file existed in my jobs QTEMP, and b) the trigger program being called also existed.

Also, bear in mind that each job has its own QTEMP which is not generally accessible by other jobs.

Hope this helps

Jonathan

ANSWERED:  Feb 15, 2006  9:36 AM (GMT)  by TomLiotta

 
Other Answers:

no, you can not. A trigger is a program runned by DB2 for you

Last Wiki Answer Submitted:  February 6, 2006  7:46 am  by  JPLamontre   0 pts.
Latest Answer Wiki Contributors:  JPLamontre   0 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Agreed, this answer is no, a trigger is attached to a physical file or table. Perhaps if you gave a short description of what you are attempting to accomplish someone may be able to give you advise on alternative solutions.

Rob

 0 pts.

 

my main purpose in trying to do something of that nature is because most of the files we use are qtemp. i’ve not been able to attach anything to those. the program i’m wanting to watch has a print file and a display but no true physical file that gets built. the files that are read by this program are read by numerous programs.

 0 pts.

 

Even if “most of the files” are in QTEMP, what does that have to do with wanting to add triggers to printer or display files? Triggers are database functions. What good would it actually do to have a trigger on a display file? (BTW, you can do things like STRCPYSCN to capture display output and CPYSPLF to capture printer output. What else would you want to do that would make any sense?)

Tom

 110,175 pts.