Re: Trigger
- From: "Stefan Wuebbe" <stefan.wuebbe@xxxxxx>
- Date: Wed, 19 Sep 2007 09:22:24 +0200
"WP" <wpaul@xxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:eZObRpm%23HHA.600@xxxxxxxxxxxxxxxxxxxxxxx
How can I write a very simple piece of code in a delete trigger so that no
orphans arise? The referential integrity builder is too complex, and
crashes my VFP9 SP2.
Assumed you've got a parent table "parent" with a primary-key field
"parent_id" and child table "child" with "parent_id" as its foreign-key
field, you could create an SP like:
Procedure ri_parent_delete()
Local luPK
luPK = parent_id && no alias name here
Delete From child Where parent_id = m.luPK
EndProc
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
.
- Follow-Ups:
- Re: Trigger
- From: WP
- Re: Trigger
- References:
- Trigger
- From: WP
- Trigger
- Prev by Date: Re: combobox readonly?
- Next by Date: Slow Accessing a memo field on a network
- Previous by thread: Trigger
- Next by thread: Re: Trigger
- Index(es):
Relevant Pages
|