REINDEX

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Aug 29 23:46:02 CDT 2005


On 8/29/05 11:25 PM, "Andrew Sinning" <andrew at learningware.com> wrote:

> I wonder if my problem is related to deletion control.  Can you please
> confirm for me the correct use of the following:
> 
> CREATE TABLE answers (
>     qRecId ObjectPtr REFERENCES questions ON DELETE CASCADE NOT NULL INDEXED
>      ...

Correct.
 
> This means that when I delete record in the table "questions" having
> "recId" = 10, then all the records in table "answers" having "qRecId" =
> 10 will also be deleted.  Correct?

yes
 
> The "CASCADE" part means that the DELETE command will cascade down to
> any object that point to these records in table "answers".  Correct?

No.

Assume you have another table TTT,
which has ObjectPtr "AnswerPtr" that point to Table answers.

Child records in table TTT will be deleted only if you specify for AnswerPtr
fields the CASCADE also.

Then you will get cascade behavior. You delete one record in top table, and
this cause deletion of related records on 2 levels.

> Is it permissible to change the type of an ObjectPtr field to an
> ordinary ULong?  

Sense?

For ULONG filed you can store RecID values in the same way.
But you loose advantage of automatic updates ON DELETE.

> If I do a ChangeFieldType(val, fieldRef, #kTypeULong),
> is this going to break the database?

No. this must work and preserve exists ULONG values.

Just what sense ?

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list