[Zope] Multiple record input into Postgresql

2000-08-10 Thread William Herring

I am new to using Zope, but have been succesfull at using a psql input
wizard to generate forms to dump data to a postgresql table.  However, I

have a dilema.  I would like to generate a form that can dump multiple
inserts to a variable, say x1, into a postgresql table.  However, there
is an additional
variable, x2 that would have to be only entered once and would be the
same
for every record for which a different x1 is entered.  I would like the
user
to enter up to 50 records for x1.  Looking at dtml syntax it seems the
dtml-in should do this.  Could anyone point me to any examples or
provide
some help?




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Multiple record input into Postgresql

2000-08-10 Thread Spicklemire, Jerry

William wrote:

 inserts to a variable, say x1, into a postgresql table.  
 However, there is an additional variable, x2 that would 
 have to be only entered once and would be the same for 
 every record for which a different x1 is entered.  
 
 it seems the dtml-in should do this.

Assign the variable x2.

dtml-call "REQUEST.set('x2',some_known_value)"

Create a list of all the x1 variables. This step could be 
a sql method, if the variables already exist in a table.

dtml-in sql_to_create_x1_list
/dtml-in

Assign the value of sequence-item to variable this_x1.

dtml-call "REQUEST.set('this_x1',_['sequence-item'])"

Create a sql method to execute the inserts, and call it 
from within the first sql method, called using dtml-in.
Be sure to include "arguments" this_x1, x2.

dtml-var sql_insert_this_x1_x2

So, altogether now:

dtml-call "REQUEST.set('x2',some_known_value)"
dtml-in sql_to_create_x1_list
 dtml-call "REQUEST.set('this_x1',_['sequence-item'])"
 dtml-var sql_insert_this_x1_x2
/dtml-in

The dtml-in statement retrieves the cursor, calling the 
sql_insert for each item (sequence-item).





___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )