On 2005-09-23 at 18:14:40 [+0200], Dale Hirt <[EMAIL PROTECTED]> wrote: > Hello, > > I have been searching both online and in this list's archives. I am still > a bit stumped however. I have two different ODBC connections to two > different Caché DB's. They have the exact same structure and column names > and types. I run a query against each of the connections and get back a > Shared.DC.ZRDB.Results class in each case. > > Has anyone come up with code to combine the results? I would be much > appreciative. If not, a pointer in the right direction would be helpful.
Hi Dale, if I understand you correctly, you want to be able to UNION the two queries. If that is the case then I'd be tempted to do this on the database side if possible. Of course, Zope does make it easy to integrate the two result sets using a PythonScript. As you can interate through the objects you can easily create two lists and combine them: results = list(context.SQL1()) results += list(context.SQL2()) If performance is an issue then you should look at combining the results on the db side. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list [email protected] http://mail.zope.org/mailman/listinfo/zope-db
