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: [EMAIL PROTECTED]
======================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to