cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: Modular Database Actions - Multiple Inserts
Date Mon, 06 May 2002 07:40:22 GMT
On 06.May.2002 -- 08:44 AM, Malte Vahlenkamp wrote:
> Hello,
> I have some problems with the modular database actions. I am trying
> to insert multiple rows from a form with several text boxes named
> ProjectParam1, ProjctParam2, ... The insert itself is runs, but all I
> get in this columns is a NULL value.  I already tried to solve this
> with a wildcard [*] but maybe I messed up something with the
> syntax. Any comments? 

The crucial part when working on more than one row is to define which
columns vary and which are constant. This is done through the "set"
attribute to a column or a mode. All columns in a set vary and all
others are fixed.

Sets have one column that is special, the master column. The master
column is used to determine a) the number of rows to work on and b)
an enumeration of objects that is used to find the corresponding value
for the other columns.

As a consequence, only columns in a set may have a wildcard. In
addition, the behaviour depends on the input module used.

Thus you are missing to things here: ParamName and UnitName must have
a set attribute and your master column needs to have a wildcard.

> 	<table name="projectparams" alias="projectparams">
> 		<keys>
> 			<key name="ProjectParamsId" autoincrement="true" type="int">
> 				<mode name="auto" type="autoincr"/>
> 			</key>		
> 		</keys>
> 		<values>
> 		<value name="ProjectId"  type="int" set="master">									
 			<mode name="attribute" parameter="org.apache.cocoon.components.modules.output.OutputModule:projects.projectid[*]"
> 		</value>
  		<value name="ParamName"  type="int" set="slave">									
> 			<mode name="request" parameter="ParamName[*]" type="all"/>			
> 		</value>
 		<value name="UnitName"  type="int" set="slave">									
> 			<mode name="request" parameter="UnitName[*]" type="all"/>			
> 		</value>
> 		</values>
> 	</table>
> 	<table-set name="userAndProjects">
> 		<table name="projects"/>
> 		<table name="userprojects" others-mode="attrib"/>
> 		<table name="projectparams" others-mode="attrib"/>
> 	</table-set>


C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message