The one risk I see here is if you are at TCL and have a bunch of keys in an active select that you are going to delete. If THAT select list is not loaded into one of the higher active select buffers (i.e. 1-9), you will have some nightmares when the SELECT in the trigger clobbers the SELECT from TCL. Just the risks we all need to keep in mind.
John Israel Senior Programmer/Analyst Dayton Superior Corporation 1125 Byers Road Miamisburg, OHÂ 45342 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Thursday, April 21, 2011 3:42 PM To: [email protected] Subject: Re: [U2] Very Weird Trigger Behavior We are doing this with a county and zip file - the trigger is on the county file and a record cannot be deleted if it's referenced in the zip file: SUBROUTINE TRIG.COUNTY.DEL (EXECSTAT, DICTFLAG, FILENAME, COUNTY_ID) EQU DELETE_DENIED TO 0 EQU DELETE_ALLOWED TO 1 EXECSTAT = DELETE_DENIED IF (UNASSIGNED(FILENAME) OR (FILENAME NE "COUNTY")) THEN RETURN END IF (UNASSIGNED(COUNTY_ID) OR (TRIM(COUNTY_ID) EQ "")) THEN RETURN END CMD = 'SELECT P_ZIP WITH COUNTY_ID EQ "':COUNTY_ID:'"' ZIP_LIST = "" EXECUTE CMD RTNLIST ZIP_LIST CAPTURING OUTPUT IF @SYSTEM.RETURN.CODE EQ 0 THEN EXECSTAT = DELETE_ALLOWED END RETURN Shaun Ferguson Applications Architect I Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA - 23602-4314 T: (757) 989-2916 - F: (757) 989-2801 - E: [email protected] www.wolseley.com <blocked::http://www.wolseley.com/> Wolseley plc registered office Parkview 1220 Arlington Business Park Theale Nr Reading RG7 4GA United Kingdom Registration No. 29846 England _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
