[Zope] Do While Loop Equivalent

David Hassalevris bluepaul@earthlink.net
Thu, 22 May 2003 08:35:01 -0700


If all your keys are null then those become duplicates?
Put a unique key in each.  If necessary add a primary key that just gets
incremental numbers.
hth
David
----- Original Message ----- 
From: "McDonnell, Larry" <lmcdonnell@protonenergy.com>
To: "David Hassalevris" <bluepaul@earthlink.net>; "'Zope@Zope. Org'
(E-mail)" <zope@zope.org>
Sent: Thursday, May 22, 2003 8:18 AM
Subject: RE: [Zope] Do While Loop Equivalent


> Hi,
>
> Sorry David, Andreas, and Dennis for the short email that did not explain
my
> problem fully (had to go to a
> meeting). I use dtml mostly but I'm starting to see the power of Python. I
> am creating a web based system to collect test data during our
manufaturing
> process. I can generate a serial number but depending on the part the
items
> within a this serial number can be 4, 10, 24, 34 items. I need to create
> these records first so they can update them as they are testing. With my
> zsql method, I am creating records with 3 fields populated using David's
> dtml-in method:
>
> <dtml-call "REQUEST.set('cell_number', 0)">
> <dtml-in "_.range(10)">
> <dtml-call "REQUEST.set('cell_stack_number', cell_number+1)">
>
> <dtml-call expr="create_atp_fields_record(REQUEST)">
> </dtml-in>
>
> But an error message:
>
> Error Type: sql.error
> Error Value: ('23000', -1605, '[Microsoft][ODBC Microsoft Access Driver]
The
> changes
> you requested to the table were not successful because they would create
> duplicate values
> in the index, primary key, or relationship. Change the data in the field
or
> fields that
> contain duplicate data, remove the index, or redefine the index to permit
> duplicate entries
> and try again.')
>
> I have no indexes or primary key set. Any sugesstions? Thanks.
>
> -----Original Message-----
> From: David Hassalevris [mailto:bluepaul@earthlink.net]
> Sent: Wednesday, May 21, 2003 4:05 PM
> To: McDonnell, Larry; 'Zope@Zope. Org' (E-mail)
> Subject: Re: [Zope] Do While Loop Equivalent
>
>
> <dtml-in "_.range(9)">
> ... add block of records
>
> </dtml-in>
> Was that what you wanted?
> David
> ----- Original Message ----- 
> From: "McDonnell, Larry" <lmcdonnell@protonenergy.com>
> To: "'Zope@Zope. Org' (E-mail)" <zope@zope.org>
> Sent: Wednesday, May 21, 2003 12:55 PM
> Subject: [Zope] Do While Loop Equivalent
>
>
> >
> > Hi,
> >
> > I have been searching for a while but I am coming up empty. I am writing
a
> > module that needs to create a block of records in the db so they can be
> > updated at a later time. In the good old days, I would use a do while
loop
> > (do something while x < 10). How can this be done? And as always any
> > pointers will be appreciated, thanks.
> >
> >
> > Larry McDonnell
> >
> > Proton Energy Systems
> > 10 Technology Drive
> > Wallingford, CT 06492
> > (203) 678-2181
> > Email:lmcdonnell@protonenergy.com
> > www.protonenergy.com
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://mail.zope.org/mailman/listinfo/zope-announce
> >  http://mail.zope.org/mailman/listinfo/zope-dev )