restricting adding records based on existence of releated record
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Jun 10 23:01:01 CDT 2004
On 6/10/04 9:49 PM, "Chris Sheffield" <cm_sheffield at yahoo.com> wrote:
Hi Chris,
> I hope this makes sense.
>
> I'm wondering if there is an internal way of
> restricting the adding of records in one table based
> on the existence (or non-existence) of a related
> record in another table.
>
> For example, in Table1 I have several fields of data.
> In Table2 I have fields ObjectPtrToTable1 and Data.
> Is there internal way to restrict adding a record to
> Table2 if there is not a related record in Table1, or
> am I pretty much just stuck with doing this in my own
> code?
You mean
1) that you try to add into T2 value of ObjectPtr of non-existed record?
Valentina 1.x will allow this.
Valentina 2.0 will NOT allow this.
2) or you mean that you want not allow adding into T2 record which has ZERO
objectPtr i.e. Do not have Parent ?
> It seems as though there should be another option for
> an ObjectPtr field like "Restrict of related record
> doesn't exist", or something like that. :-)
Yes, in 2.0 this will be ALWAYS. This is right.s
It works in 2.0 for ObjectPtr and for FOREIGN KEY.
In 1.x you can self check RecID that you assign.
On the other hand why you need worry about its validity?
Where from you get this RecID?
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list