Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Multiple schema files?
Multiple schema files? [message #26905] Mon, 07 June 2010 19:20 Go to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I am wondering if it's possible to have multiple schema files and multiple databases? Here's the synario... I am writing a program that allows one to log amateur radio contacts. To do so, we often refer to many other data sources, such as the FCC license data (about 86mb when put into a sqlite3 db), Canadian license data, country data (latitude/longitude for centers, callsign attributes, etc...).

So, that database winds up being pretty big. Then there is the actual "logbook" which tracks the actual contacts that a ham operator makes. This database, having 5-8 tables and the largest one containing about 40 fields is pretty small. Also, the operator may have multiple log books, one for a contest they've run, another for their home operations and another for mobile operations. Many families have multiple ham operators as well.

So the program ideally should have two data sources, the static reference data (callbooks, country information, etc...) then the actual logbook which can be opened, closed, imported, exported, synced w/laptop resource, etc... I'd rather not have to have the user maintain the large static database in their individual log file.

Can this be done? Is there an example or information on this? I thought of using attach to "include" the static data into the main database, but how would that work when creating the database for the first time (the logbook database)? I'm afraid that the static data tables would be created in the logbook database?

Thanks for any input,

Jeremy

[Updated on: Mon, 07 June 2010 19:29]

Report message to a moderator

Re: Multiple schema files? [message #26954 is a reply to message #26905] Sun, 13 June 2010 18:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
jeremy_c wrote on Mon, 07 June 2010 13:20

I am wondering if it's possible to have multiple schema files and multiple databases? Here's the synario... I am writing a program that allows one to log amateur radio contacts. To do so, we often refer to many other data sources, such as the FCC license data (about 86mb when put into a sqlite3 db), Canadian license data, country data (latitude/longitude for centers, callsign attributes, etc...).



Yes, of course. Having multiple .sch files is quite normal.

Using more than single database connection at time is less usual, but definitely possible.

Quote:


So, that database winds up being pretty big. Then there is the actual "logbook" which tracks the actual contacts that a ham operator makes. This database, having 5-8 tables and the largest one containing about 40 fields is pretty small. Also, the operator may have multiple log books, one for a contest they've run, another for their home operations and another for mobile operations. Many families have multiple ham operators as well.

So the program ideally should have two data sources, the static reference data (callbooks, country information, etc...) then the actual logbook which can be opened, closed, imported, exported, synced w/laptop resource, etc... I'd rather not have to have the user maintain the large static database in their individual log file.

Can this be done? Is there an example or information on this? I thought of using attach to "include" the static data into the main database, but how would that work when creating the database for the first time (the logbook database)? I'm afraid that the static data tables would be created in the logbook database?



But this rather sounds like some tables with more or less static data fit your scenario equally well?

Mirek
Re: Multiple schema files? [message #26958 is a reply to message #26954] Sun, 13 June 2010 20:03 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Yes, but I am confused as to what your proposed solution is to my problem of wanting to have a log file database and also the static data file.

If I could manage two difference schema files, so that when I create one (say a new logbook) that it does not create all the static database table definitions, I could manage the rest with SQLite's attach/detach methods.

I am just unsure of how to have two schema files that remain independent of each other but usable both usable in the same app.

Jeremy
Re: Multiple schema files? [message #26962 is a reply to message #26958] Mon, 14 June 2010 10:13 Go to previous message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
jeremy_c wrote on Sun, 13 June 2010 14:03

Yes, but I am confused as to what your proposed solution is to my problem of wanting to have a log file database and also the static data file.

If I could manage two difference schema files, so that when I create one (say a new logbook) that it does not create all the static database table definitions, I could manage the rest with SQLite's attach/detach methods.



Hm, you want to have each logbook in differenet database?

Well, perhaps with SQLite, not a bad approach...

Quote:


I am just unsure of how to have two schema files that remain independent of each other but usable both usable in the same app.



I am just unsure where lies the problem? In the end, .sch file simply provides a single "All_Tables" *static* function. Use that to provide your own name for your schema function. Then each schema is represented by distinct function. Use it to create scripts, then use scripts to create model in each DB backend...
Previous Topic: Two tables sharing same field name?
Next Topic: SqlCtrls and IsModified()
Goto Forum:
  


Current Time: Fri Nov 01 01:36:40 CET 2024

Total time taken to generate the page: 0.02371 seconds