Download presentation
Presentation is loading. Please wait.
Published byJonas Barker Modified over 9 years ago
2
Session 4718 Triggers Unlimited National Harbor 6 & 7 Tuesday 4/07/2009 3:45pm Jeff Butera -- Hampshire College Pieter Crow -- Central Wyoming College
3
Outline What is a trigger? What can triggers do? How do you setup triggers? Trigger examples Tips and tricks Questions
4
What is a trigger? Piece of executed code Triggered by certain events Unidata specifics: Code is a Unibasic subroutine or function Trigger can be invoked when a record is – Created – Modified (written) – Deleted
5
What can triggers do? Triggers are useful for automated processing ADDOPR, CHGOPR Virtual fields too slow? – No problem, make ‘em computed with a trigger Stored computed columns Status and/or status date fields Notify (email?) when certain things happen
6
How do you setup triggers? Create subroutine with 5 arguments: EXECSTAT out (0,1,2) DICT.FLAG in (“”,“DICT”) FILENAME in (“STUDENTS”) ID in (“0023450”) RECORD in/out Compile and GLOBALLY catalog CREATE.TRIGGER FILENAME SUBNAME UPDATE
7
Trigger examples at Hampshire Find bad HTML in course descriptions Edit A/R to NOT show dorm assignment FMLA check on complete timecard Log deletes, cleanup pointers Auto assign ID Card type (& export) Validate data entered Stored computed columns (realtime)
8
Jeff’s tips and tricks * cleanup some simple HTML SWAP ' ' WITH ' ' IN X.DESC SWAP '<a href' WITH '<A HREF' IN X.DESC SWAP '<a HREF' WITH '<A HREF' IN X.DESC * Strip out some bad binary multibyte chars CALL H08.IC.S.FIX.BAD.ASCII.CHARS(X.DESC )
9
Trigger examples at Central Wyoming
10
Pieter’s tips and tricks
11
More information Unidata documentation (a little thin): Developing Unibasic Applications Chapter 4 – Maintaining Data in Files Section on database triggers
12
Questions Jeff Butera jeff@hampshire.edu http://jeff.hampshire.edu Pieter Crow pcrow@cwc.edu
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.