cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malte Vahlenkamp" <Malte.Vahlenk...@bdal.de>
Subject DatabaseAction
Date Wed, 06 Feb 2002 14:21:19 GMT
Hello,
is there a way, to insert the data of an HTML-Form into more than one database table? I have
tried to do this via a database action (org.apache.cocoon.acting.DatabaseAddAction) and the
following mapping: 




<root>
  <parameter name="ProjectId" type="long" nullable="no"/>
  <parameter name="ProjectName" type="string" min-len="5" max-len="64"/>
  <parameter name="UserId" type="long" nullable="no"/>

  <connection>demo</connection>
  <table name="projects">
    <keys>
      		<key param="ProjectId" dbcol="projectid" type="int" mode="manual"/>
    </keys>
    <values>
      <value param="ProjectName" dbcol="projectname" type="string"/>
      <value param="UserId" dbcol="userid" type="string"/>
    </values>  		            
    
   <table name="userprojects">	    	      		    
	    <keys>
      		<key param="ProjectId" dbcol="projectid" type="int"/>
            </keys>
	    <values>      	      				
		<value param="UserId" dbcol="userid" type="int"/>
	    </values>    
      </table>          	        
  </table>                	    
</root>


This mapping works fine for the first table, but tries to insert a ProjectId of NULL into
the second table. What I want is to insert the generated key of the first table instead.

Any ideas how to do this? 

Thanks for your time

  Malte


======================================================
Malte Vahlenkamp
Bruker Daltonik GmbH
Fahrenheitstr. 4
28359 Bremen, Germany
Phone: +49-421-2205-486
email: mv@bdal.de
======================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message