Joseph Morgan - asks HOW TO work with Foreign Keys?

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Sun Oct 13 10:47:17 CDT 2013


On 10/13/13 5:38 PM, "Joseph Morgan" <joseph at checkos.com> wrote:

Hi Joseph, 

> I tried to create the link in Vstudio.
> 
> Two Tables as example:
> 
> CREATE TABLE "Invoices1"(
> "InvoiceDate" DATE,
> "field1" ULONG,
> "rowID" ULONG METHOD ( 'RecID' ) );
> 
> 
> CREATE TABLE "InvoiceItems"(
> "InvoiceKey" ULONG,
> "rowID" ULONG METHOD ( 'RecID' ) );

Hi Joseph,

For FK-links, I will recommend use not CREATE LINK command,
But something standard what have all other dbs.

Example:
       http://www.w3schools.com/sql/sql_foreignkey.asp




CREATE TABLE "InvoiceItems"(
 "InvoiceKey" ULONG FOREIGN KEY REFERENCES Persons(rowID),
  "rowID" ULONG METHOD ( 'RecID' )
);



===================
Important notes:

**  If you want true ROWID, you can use new in 5.0 feature
  SEQUENCES, like in Postgre


** if it is okay to use RecID itself, then you may want use
       RecID-ObjectPtr   combination.

It is more simple and more effective that FK-link.

 

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