Valentina Digest, Vol 22, Issue 17
Ruslan Zasukhin
sunshine at public.kherson.ua
Sun Oct 24 09:39:08 CDT 2004
On 10/24/04 4:20 AM, "Thomas" <totoole at rocko.lab.csuchico.edu> wrote:
>>>> The following Base Object Method is causing trouble in VAPP.
>>>>
>>>> if(ptr_parent_rcd = ptr_child_rcd,'False',if(ptr_parent_rcd
>>>> ptr_child_rcd,concat(ptr_parent_rcd,'-
>>>> ',ptr_child_rcd),concat(ptr_child_rcd,'-',ptr_parent_rcd)))
>>> The "On delete" property for both the parent and child ObjectPtrs in
>>> the lookup table is set to "Cascade". So the ObjectPtrs are deleted
>>> when the RecIDs they point to are deleted, no? Does this not prevent
>>> re-use mistakes? Is there a better way to manage these comparisons?
>>
>> But you compare RecIds !
>>
>> Why ?
>>
>> Explain your idea please
>>
>> You think that PARENT always have less RecID then child ?
>
> A little hard to explain. Maybe this will help.
>
> Fact Table_______________________
> Fct_Tbl_RecID Fct_Tbl.Data_Field
> 10 Thomas
> 20 Mary
> 30 Jane
> 40 Lena
> 50 Lily
>
> Lookup Table_(2 Ptrs to 1 Fact_Table)__
> Ptr_Parent_Rcd Ptr_Child_Rcd
> 10 20
> 10 30
> 40 30
>
> Recursive many to many on the one Fact table. Any fact record can be
> related to any other fact record. Lookup table tells which records are
> related (linked) to which other records.
This is clear.
You try to build self-recursive M : M link on table.
> Thomas is related to Mary and Jane. Lena is related to Jane.
Clear.
> Lookup table records have to be unique. We have Thomas related to Mary
> (Lookup_Table first record 10 to 20). We don't need, and so try to
> prevent, Mary related to Thomas (20 to 10).
Okay I see your task.
if( ptr_parent_rcd = ptr_child_rcd,'False',
if( ptr_parent_rcd > ptr_child_rcd,
concat(ptr_parent_rcd,'-',ptr_child_rcd),
concat(ptr_child_rcd,'-',ptr_parent_rcd)))
Aha. So you try to build string that contains 2 numbers sorted in ASC order.
I see. Correct.
I think you get problems because for cases when ptrs are equal you produce
string 'False'.
This means that you can have 2 and 3 and more time the same string 'False'.
And this is why you get NOT UNIQUE error.
Right ?
> Base Object Method won't allow import of new Lookup_Table records.
> Would like to import 50 to 40, 50 to 10, etc. But Base Object Method
> thinks these are not unique.
Wait. How you are going import values into RecID field ?????
This is READ ONLY field.
Thomas, I think you need create in the table FactTable own
"ID" as Long field
Then you will be able import into it.
--
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