Susan: To expand further on Jeff's comment, the EXECSTAT variable is part of the CALL arguements list. For instance, in UniData an update trigger might look like: 001 SUBROUTINE U2.MASTER.TRIGGER.U ( ExecStat, DictFlag, atFILENAME, atID, atRECORD ) The following table describes each parameter of the syntax. ** Parameter Description ** ---------- -------------------------------------------------------- ** trigname The name of the globally cataloged subroutine. ** execstat The execution status returned by the trigger subroutine: ** 0 - No updates are allowed. ** 1 - Updates are allowed. ** 2 - Updates are allowed, using the return recordval. ** dictflag "DICT" - Indicates that the trigger is operating on the ** dictionary file. ** "" - Indicates that the trigger is operating on the ** data file. ** Note: the quotation marks are required. ** filename The name of the file on which the trigger is operating. ** item ID The item ID of the record to be updated. ** recordval The input record value submitted to the UPDATE trigger. ** "recordval" is both an input and output parameter. The ** trigger can change this value (for example, by performing ** a conversion). Then, if the trigger sets execstat to 2, ** this value is passed back in recordval and updates the ** data record. Only strings and numbers are valid. ** ** If the value returned in recordval is invalid, the record ** is not updated, even if the trigger subroutine sets execstat ** to 2. In this case, the UniBasic STATUS function returns 3 ** when executed immediately after the command that calls the ** trigger. Only strings and numbers are valid. Therefore, you pass EXESTAT in and out of the CALLed program, set its value, and UniData knows it and responds to the setting accordingly. HTH, Bill ______________________________________________________________________
Jeff Butera wrote on 12/1/2008 8:46 AM: <quote who='Susan Joslyn' date='Monday 01 December 2008'> Hi everyone, I have the triggers working - yay! Thanks Manu! - but now I'm to the next step, and of course stumbling again! My program sets a flag when it wants to disallow the write that called the trigger. The manual seems to suggest that I could use SetDiagnostic to fail this . but I'm not even getting my program to compile and can't find further information on the syntax of that command. Anyone know how to tell the trigger to refuse the write? I can't comment for Universe, but in Unidata you set EXECSTAT to one of three values 0 = don't write the record 1 = write record, but don't allow trigger to have altered the contents 2 = write record and allow trigger to possibly have altered contents ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
