Re: [sqlite] Problems with 'references'

2008-12-04 Thread Tony Mc
On Thu, 04 Dec 2008 10:34:59 +1100, you wrote:

> Tks.  It would help if the doco made that known.

It is documented in the section that deals with omitted features of
SQL, which you can find at: http://www.sqlite.org/omitted.html

Best,
Tony
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problems with 'references'

2008-12-03 Thread Igor Tandetnik
Howard Lowndes <[EMAIL PROTECTED]> wrote:
> I'm playing about with the following syntax:
>
> CREATE TABLE atable (
> a_ref integer
> not null
> primary key autoincrement,
> a_text text
> );
>
> CREATE TABLE btable (
> b_ref integer
> not null
> primary key autoincrement,
> b_text text,
> a_ref integer
> not null
> default 0
> references atable (a_ref)
> on delete set default
> on update cascade
> );

Be aware that SQLite silently ignores REFERENCES clause (together with 
on delete, on update parts). You will have to create triggers to enforce 
these constraints.

> Have I misunderstood the syntax for the SQL REFERENCES statement, or
> is the following from 2003 (??) still applicable:
>
> "That's not a legal FOREIGN KEY clause; you have to specify what the
> foreign key references. SQLite parses, but does not enforce,
> syntactically-legal FOREIGN KEY specifications; there's a PRAGMA that
> will retrieve foreign-key information from table definitions, allowing
> you to enforce such constraints with application code."  which is in
> http://www.sqlite.org/cvstrac/wiki?p=UnsupportedSql

Still applicable.

Igor Tandetnik



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users