[Zope-DB] Querying many DBs from one set of SQL methods?

Stuart Nicholson stuart.nicholson@wirelessdatanz.com
Mon, 17 Sep 2001 16:49:26 +1200


The itch: I need to have a single set of Z SQL methods that can be run against multiple databases as part of a common web interface driven by data held in different client's
databases. 

A problem: However when defining a Z SQL method you are required to select an existing Zope Database Connection instance that the SQL method will run against. 

A scatch?: To me (being something of a Zope novice), it would appear to scratch my itch I have to 'copy and paste' into different folders (say one per client), duplicating my
common SQL methods, defining the appropriate DB Connection in each folder and then changing each duplicated SQL method to point to that connection. This seems a rather
inelegant solution.

Is there a better way?: I haven't tried but imagine I can programatically change the DB Connection properties prior to running each request. Is this a viable solution? Will
this work with multiple clients running the same query for example? Can anybody suggest a better solution?

Thanks in advance,

Stuart Nicholson
Software Engineer
Wireless Data


---------------------------------------------------------------------- 
The information contained in this communication is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it.  It may
contain confidential or legally privileged information. 
If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is
strictly prohibited and may be unlawful. 
If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. 
Wirelessdata Ltd is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
----------------------------------------------------------------------