Help needed: SQL Creation of ObjectPtr

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Nov 28 05:10:14 CST 2007


On 28/11/07 12:35 PM, "Karl Grob" <kgrob at mus.ch> wrote:

> Hi
> 
> Can anyone give me some help?
> 
> ALTER TABLE tbl_Wortindex
> ADD tbl_Wortindex_eroeffnetVon OBJECTPTR INDEXED
> REFERENCES  tbl_Benutzer ON DELETE SET NULL
> CONSTRAINT Link_tbl_Wortindex_eroeffnetVon
> ON UPDATE NULL
> 
> does work, but gives the following results:
> 
> The Link Name is not "Link_tbl_Wortindex_eroeffnetVon" but "Link_1"
> 
> All this does not work without "ON UPDATE NULL" and it does not accept
> the DELETE statement in place of the UPDATE-Statement. In WIKI I read:
> ---
> CREATE TABLE T2(
>    T1_PTR ObjectPtr REFERENCES TABLE_1 CONSTRAINT link_T1_T2
>    ON DELETE CASCADE
> )
> You can see that ObjectPtr field needs only Target Table
> specification, but do not need the key field of that table, because
> always a RecID field of Target Table is used. Also ObjectPtr field do
> not need ON UPDATE action.
> 
> ---
> 
> I really have problems to find working examples (No example for ALTER
> TABLE! ALTER TABLE is especially for Links a very common situation.
> Circles are forbidden, arent they?).

You can have SELF-recursive pointer
    as for Foreign key, so for ObjectPtr.

For 2 tables you also can have circle via pointers...why not.
    to establish this - yes you need use for one table the ALTER TABLE.

Btw TIP, you can in Vstudio setup structure you need, then do SQL dump of
structure to see how it will be done.

--------
> Perhaps there is some help out there.

This is from our regression tests:

"CREATE TABLE t2 ( f1 long, ptr ObjectPtr REFERENCES t1 ON DELETE SET NULL)"

"CREATE TABLE t2 ( f1 ObjectPtr REFERENCES t1 ON DELETE SET NULL)"

"CREATE TABLE t2 ( fPtr ObjectPtr REFERENCES t1 ON DELETE SET NULL ) "

"CREATE TABLE t2 ( ptr ObjectPtr REFERENCES t1 ON DELETE CASCADE)"

"CREATE TABLE t1 ( id long unique, ptr ObjectPtr REFERENCES t1 ON DELETE
CASCADE ) "

"CREATE TABLE t1 ( id long unique, ptr ObjectPtr REFERENCES t1 ON DELETE
CASCADE ) "

"CREATE TABLE t6 ( f1 ObjectPtr REFERENCES t1 ON DELETE SET NULL)"

-- 
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