Hi there,

I have a problem using the DatabaseAddAction in MySQL.

I would do two table insertions, one after an other like the following
example:


  INSERT INTO base (id,...) VALUES(NULL,...); 
# id is defined as INT NOT NULL AUTO_INCREMENT

  INSERT INTO derived (id,....) VALUES(LAST_INSERT_ID(),....);

<employee>
  <connection>personnel</connection>
  <table name="base">
    <keys>
      <key param="id" dbcol="id" type="int" mode="manual"/>
    </keys>
    <values>
      <value param="myparam" dbcol="...." type="string" />
    </values>
  </table>
  <table name="derived">
    <keys>
      <!-- how can I use the mysql LAST_INSERT_ID() here,
           in order to insert the previous inserted auto_increment value
?-->
      <key param="id" dbcol="id" type="int"/>
    </keys>
    <values>
      <value param="..." dbcol="..." type="string" />
    </values>
  </table>
</employee>

Is there someone that has an idea how to solve this?

Thank you in advance for your answer

Regards,

pino



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

Reply via email to