Re: [sqlite] sqlite connection?
On Tue, May 11, 2010 at 01:45:03PM -0400, john cummings scratched on the wall: > hi all, > > i'm new to this forum and sqlite. > > is it possible to have an executable (i.e. .exe) with connections to 2 > sqlite databases? > > i've read doc and it doesn't speak to this one way or the other. Yes. Just call sqlite3_open_xxx() more than once. You can also have one database connection manage more than one database file. Among other this, this allows you to formulate queries that gather data from both databases. See the SQLite SQL command "ATTACH". -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite connection?
On 11 May 2010, at 6:45pm, john cummings wrote: > is it possible to have an executable (i.e. .exe) with connections to 2 > sqlite databases? > > i've read doc and it doesn't speak to this one way or the other. Sure. Use sqlite_open() two times, and keep the returned values in two separate variables. Make sure you use the right one for each subsequent operation. When you're finished with each database, call sqlite_close() on that one, not the other one. http://www.sqlite.org/c_interface.html Note to the SQLite docos: section 3.10 of that page is entirely in bold because of a tag problem. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite connection?
Yes. One can also attach 'somedatabase path' as anothername ; and you can run a query accessing both at the same time. regards, Adam On Tue, May 11, 2010 at 1:45 PM, john cummingswrote: > hi all, > > i'm new to this forum and sqlite. > > is it possible to have an executable (i.e. .exe) with connections to 2 > sqlite databases? > > i've read doc and it doesn't speak to this one way or the other. > > thanks, > > john > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 7100 Warden Ave, Unit 3 Markham ON, L3R 8B5 Canada ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite connection?
On Tue, May 11, 2010 at 12:45 PM, john cummingswrote: > hi all, > > i'm new to this forum and sqlite. > > is it possible to have an executable (i.e. .exe) with connections to 2 > sqlite databases? I've never made an executable, but given that I can do so with Perl, I don't see why not. A connection is just a handle. Just give different connections different names. Heck, you could make multiple connections to multiple different databases... one to sqlite, one to Pg, another one to MySQL, another one to sqlite. Knock yourself out Go crazy. > > i've read doc and it doesn't speak to this one way or the other. > > thanks, > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu --- Assertions are politics; backing up assertions with evidence is science === ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users