RE: [Zope] Bulk insert in Zope's ZPyGres
Thanks. But how do use insert statements thru Z SQL Mtehod submitting it again? We will need to submit the web page a lot of times to get the variables across, wouldn't we? How do we address this problem ? Again, please reply to my personal mail also. ---------- From: "Phillip J. Eby" Sent: Wednesday, July 21, 1999 9:00 AM To: Paul Chung Chee Soong; zope Subject: Re: [Zope] Bulk insert in Zope's ZPyGresql Content-Type: text/plain; charset="us-ascii" X-Loop-Detect: 1 At 09:18 AM 7/21/99, Paul Chung Chee Soong wrote:
Hi. I'm beeen using Zope-1.10.3-src, Zap-1.10, RedHat 5.2 and lately ZPyGresql Database Adaptor. Okay, the problem is can I do the aboved. For instance, I put a few checkboxes (the amount is dynamic) on the page. Then the user will click on the items they want to borrow and press the
submit button. After that, the next page will insert all this entries into records in a postgres table.
Just make the checkbox field a :list field, and have your SQL method do an <!--#in--> block that loops over it to create a series of INSERT statements in one batch.
At 10:37 AM 7/22/99 +0000, Paul Chung Chee Soong wrote:
Thanks. But how do use insert statements thru Z SQL Mtehod submitting it again? We will need to submit the web page a lot of times to get the variables across, wouldn't we? How do we address this problem ?
As I said before, just make the checkbox field a :list field, and have your SQL method do an <!--#in--> block that loops over it to create a series of INSERT statements in one batch. For example, if your checkbox field is called "item_to_borrow:list". Your SQL method would look something like: <!--#in item_to_borrow--> INSERT INTO my_table (the_item) VALUES (<!--#var sequence-item-->) <!--#/in--> Obviously, you would need to change this to suit the values you actually need to insert. The above will generate a series of INSERT statements in a single batch, one for each checked item. When the SQL method runs, it will send all the INSERT's to the database at once.
participants (2)
-
HCSCCSï¼ prudential.com.my -
Phillip J. Eby