[Zope-DB] result

Jim Penny jpenny@universal-fasteners.com
Tue, 11 Mar 2003 19:32:17 -0500


On Tue, Mar 11, 2003 at 04:15:00PM -0800, D. Rick Anderson wrote:
> well .. unfortunately we dont' have access to the actual db server yet, 
> and won't for another year. My boss wants me to parse this site, that 
> will be composed of some 50-60 different reports, based on the CSV files 
> that we get daily. I just don't want to have to rewrite those 50 reports 
> to read the info from a DB connection once we get it.
> 
> I'll check Shared.DC.ZRDB.Results and see what I can dig up there. 
> Andrew suggested using a dictionary, but I can't get it to behave 
> exactly like an SQL query, so that's out. Any more info you have will 
> help. I dug through a couple of DAs but the code is too thick for me to 
> figure out.
> 
> Thanks for the reply,
> 

It is probably still far easier to write a few small programs to create
insert statements from the CSV's and put them into a database than it is
to do what you are trying.  You will get performance benefits, and
equally importantly, using scripts, you should be able to schedule and
automate the entire process.

But, look at the ZGadFlyDA again, it is about as simple as is possible,
maybe a bit more simple.

Jim

> Rick
> 
> 
> Jim Penny wrote:
> 
> >On Tue, Mar 11, 2003 at 03:16:18PM -0800, D. Rick Anderson wrote:
> > 
> >
> >>I sent this to the zope@zope.org board, but nobody answered and I 
> >>supposed it's because it's more DB related. ;-)
> >>
> >>I need to know how to build a 'result' like the ones that are returned 
> >>from a query. I'm wanting to take a set of data, and be able to use it 
> >>with dtml-in exactly like I would an SQL query. Mainly because 
> >>eventually it will be replaced by an actual query and I dont' want to 
> >>have to re-code this whole site when it does.  I read 'How to write a 
> >>DA' on the Zope.org site, but it's section on the result is terse and 
> >>doesn't really explain what you have to do.
> >>   
> >>
> >
> >I don't want to be negative here, but, don't do it for this reason.  It
> >will be far easier simply use a database and a matching adapter.  ZSQL
> >Queries are very easy to create; you think you want one in the future;
> >so make the future now!
> >
> >Now, that being said, you probably want to look at the query method of
> >an existing DA; for example
> >$ZOPEPATH/lib/python/Products/ZGadflyDA/db.py
> >
> >Jim Penny
> >
> >
> > 
> >
> >>Thanks,
> >>
> >>Rick
> >>
> >>
> >>
> >>
> >>
> >>_______________________________________________
> >>Zope-DB mailing list
> >>Zope-DB@zope.org
> >>http://mail.zope.org/mailman/listinfo/zope-db
> >>
> >>   
> >>
> >
> >_______________________________________________
> >Zope-DB mailing list
> >Zope-DB@zope.org
> >http://mail.zope.org/mailman/listinfo/zope-db
> >
> > 
> >
> 
> 
> 
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
>