Relation links

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Feb 24 20:36:17 CST 2004


on 2/24/04 8:09 PM, James Milne at james.milne at mac.com wrote:

Hi James,

> I'm trying to figure out how to build relation links between tables
> using SQL.
> 
> Here is the code I'm using to be a part of my schema:
> 
>  ' Create timeline table
>  statement = "create table timeline ("
>  statement = statement + "name varchar(64) indexed "
>  statement = statement + ")"
> 
> recCnt = db.SqlExecute( statement )
> 
>  ' Create timeline track table
>  statement = "create table timelineTrack ("
>  statement = statement + "fkTimeline ulong references timeline on
> delete cascade, " // foreign key to timeline

REFERENCES works for ObjectPtr field only now.

In 2.0 it works for all field types, as required for RBDB FOREIGN KEY.

If you have no problems with ObjetcPtr then use them.


>  statement = statement + "key varchar(32) "
>  statement = statement + ")"
> 
> recCnt = db.SqlExecute( statement )
> 
>  ' Create timeline clip table
>  statement = "create table timelineClip ("
>  statement = statement + "fkTrack ulong references timelineTrack on
> delete cascade, " // foreign key to track
>  statement = statement + "position double, "
>  statement = statement + "inPoint double, "
>  statement = statement + "outPoint double, "
>  statement = statement + "path text(64) "
>  statement = statement + ")"
> 
> recCnt = db.SqlExecute( statement )
> 
>  ' Create timelineKeyframe table
>  statement = "create table timelineKeyframe ("
>  statement = statement + "fkTrack ulong references timelineTrack on
> delete cascade, " // foreign key to track
>  statement = statement + "position double, "
>  statement = statement + "value double "
>  statement = statement + ")"
> 
> recCnt = db.SqlExecute( statement )
> 
> This code doesn't seem to be working. Any ideas what is wrong with 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