cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject [c2] multi-add database action
Date Wed, 16 May 2001 21:11:02 GMT
someone (martin?) had posted a question regarding modifying berin's
database add action to add multiple rows to a table. i have a similar need
now. i want to add not just multiple rows to a table, i want to add
multiple rows to multiple tables from one form. after some pondering, i
was thinking a scheme like this might be good. the form descriptor would
be expanded to allow multiple tables, and the param attribute values could
have wildcards in them:

  <table name="product_table">
      <key param="id" dbcol="id" type="int" mode="manual"/>
      <value param="name" dbcol="name" type="string"/>
  <table name="product_meta_element_table">
      <key param="id" dbcol="product_id" type="int" mode="manual"/>
      <key param="product_meta_element_name_*" dbcol="name" type="string"/>
      <value param="product_meta_element_value_*" dbcol="value" type="string"/>

for each request parameter that fit the wildcard pattern (e.g.
product_meta_element_name_1), if all other wildcarded parameters also had
a similarly named request parameter (product_meta_element_value_1), a row
would be inserted into the table.

any comments? berin, do your database actions handle multi-column primary
keys properly right now?

- donald

To unsubscribe, e-mail:
For additional commands, email:

View raw message