Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB Extensions » View Thread |
Messages 1 to 2 of 2 total |
LIB - proc, RemoveDetailProc.sql |
Wed, Feb 8 2012 7:43 AM | Permanent Link |
Lucian | CREATE PROCEDURE "RemoveDetailProc" (
IN "TableName" VARCHAR(40) COLLATE "UNI_CI", IN "KeyFieldName" VARCHAR(40) COLLATE "UNI_CI", IN "OldKeyValue" INTEGER) BEGIN DECLARE TriggerStatement STATEMENT; PREPARE TriggerStatement FROM 'DELETE FROM '+TableName+' WHERE '+KeyFieldName+'=?'; EXECUTE TriggerStatement USING OldKeyValue; END sample of usage, from a BEFORE DELETE trigger: BEGIN CALL RemoveChildrenProc('usergroups', 'UserID', OLDROW.UserID); CALL RemoveChildrenProc('userrights', 'UserID', OLDROW.UserID); ... END where - 'usergroups', 'userrights' are detail tables - 'UserID' is the key field in the detail table |
Thu, Feb 9 2012 4:33 AM | Permanent Link |
Lucian | > CALL RemoveChildrenProc('usergroups', 'UserID', OLDROW.UserID);
Crap, that was supposed to be RemoveDetailProc. I changed the name in the last moment thinking it was more appropriate, but than I copied the usage sample straight from some script |
This web page was last updated on Friday, April 19, 2024 at 07:09 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |