Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 4 of 4 total |
How to delete detail records through master before trigger |
Fri, Apr 29 2011 8:03 AM | Permanent Link |
Jianfei Xu | I would like to force the delete detail records before delete master records.
What is the best way to do it. I tried use on before delete trigger something like this EXECUTE IMMEDIATE 'DELETE FROM DetailTableName WHERE xMasterGUID=''+OLDROW.xGUID+''' not working Thanks, Jianfei |
Fri, Apr 29 2011 8:35 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Jianfei
I use the after delete trigger with the same code as you and it works fine. Try switching from before delete to after delete. I'd always prefer to use after delete just in case it doesn't delete after all. Roy Lambert |
Wed, May 4 2011 4:06 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Jianfei,
<< What is the best way to do it. I tried use on before delete trigger something like this >> What are you seeing - an error message or does it simply not work ? -- Tim Young Elevate Software www.elevatesoft.com |
Sat, May 7 2011 10:11 AM | Permanent Link |
Jianfei Xu | Just Do nothing.
I am using following Code, it works CREATE TRIGGER DD_xDP_ProgressActivity AFTER DELETE ON xDP_ProgressActivity BEGIN DECLARE DD STATEMENT; PREPARE DD FROM 'DELETE FROM xDP_ProgressActivity_File WHERE xFileGUID=?'; EXECUTE DD USING OLDROW.xGUID; END Thanks, |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |