[Zope-DB] Batch update mode

Chan YH cyhoong at pc.jaring.my
Thu Aug 7 11:29:38 EDT 2003


I phrased my question wrongly in my previous email and wished to thanks
those who replied.

I am trying to insert/update a table in a batch mode.
The coding below is a simplified version.

What I wanted to do is to INSERT/UPDATE a table (contact ) in a BATCH  mode.
The user will see a form listing (company) and select the option from  table
(person).

Upon completion, the user a submit the matched listing to be inserted in
another table (contact).

I need some help  in doing this in a BATCH mode.

For e.g.  if I have 10 companies with the selected persons in a batch
to be inserted into contact table.

  Company name        Person
  (company table)          (person table)
 ----------------        --------
1. company A           Chan
2. company B           Henry
...
10. company X          Robert

insert/update batch to contact table.

Could someone give me some guidance?


TQ


Data Entry Form
============
<dtml-var standard_html_header>
<h2><dtml-var title_or_id></h2>
<form method="post" action="form2_action" enctype="multipart/data">
<table>
   <dtml-in listCompany_sql>
      <tr>
         <td>Company:</td><td><dtml-var co_name></td>
         <td><select name="last_name" value="">
                   <dtml-in listPerson_sql>
                      <option
value="&dtml-last_name;">&dtml-last_name;</option>
                   </dtml-in listPerson>
             </select>
          </td>
      </tr>
   </dtml-in listCompany>
   <tr>
      <td><input type="submit" value="Submit" name="submit" /></td>
   </tr>
</table>
</form>
<dtml-var standard_html_footer>

SQL methods
==========
listCompany_sql
-----------------
select * from company

listPerson_sql
-------------
select * from person

 CREATE TABLE contact
(
 first_name        char(20),
 last_name         char(20),
 co_name           char(20),
 co_phone          char(20)
 );

CREATE TABLE person
(
name_id           int PRIMARY KEY,
first_name        char(20),
last_name         char(20)
);

CREATE TABLE company
(
co_id              int PRIMARY KEY,
co_name         char(20),
co_phone        char(20)
);




More information about the Zope-DB mailing list