Hi. I'm real new to SQLite via the command line, but I have used CoreData
quite a bit on OSX. My problem is that I have two tables that I want to link
via a unique ID, but I don' t know how to automatically link the ID
parameter properly. My tables look like this:

create table snapshot( id INTEGER PRIMARY KEY, bumf TEXT );
create table sample( snapshotid INTEGER, type TEXT, used INTEGER );

Now when I insert an entry into the snapshot with:

insert into snapshot (bumf) values ('one');

I want to insert a number of entries into the 'sample' table and make sure
their 'snapshotid' value is set to the one just created in the previous
'insert into snapshot...' command.

I know that this stuff is possible because CoreData does this sort of thing
but hides it behind a nice API. How do I create such a relationship with
sqlite via the command line ?

One more thing... the online references I've found for SQL and SQLite seem
very basic and don't talk much about linking tables together and things like
many-to-many relationships... Can anyone recommend some more thorough
documentation, either electronic or in print ?

Thanks for your patience.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to