InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

InstantDB: Foreign keys in alter table


Hi,

I have two tables namely userTable and userProfile. The userTable is the
parent and userProfile is the child table. I create the tables using the
command:

    a) create table userTable (handle INT unique primary key, name varchar
(20))

     -- This is sucessful. The uniqueness is checked during row additions.

    b) create table userProfile (userHandle INT foreign key references
userTable(handle), profileHandle INT )

Now InstantDB checks properly whenever a new row is added in the
userProfile, to make sure that particular key exist in userTable.  Checks
are also done when I do a delete from userProfile to make sure that key not
exist in UserProfile. So, the reference checks work sweet when I create
primary and foreign keys during create table.
However, the same stuff does not work when I create foreign key using alter
table. No referential checks are done.

   a) create table userTable (handle INT unique primary key, name varchar
(20))

   b) create table userProfile (userHandle INT, profileHandle INT)
       alter table userProfile add foreign key (userHandle) references
userTable (handle)

This way of creating foreign key does not check for referential integrity.
Is there anything I am doing wrong here? Is this a known problem? I am kind
of new to SQL and instantdb.

Thanks,
Lalitha


-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.