cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giuseppe Di Pierri" <p...@arpage.ch>
Subject using MSQL's LAST_INSERT_ID() with DatabaseAddAction
Date Fri, 01 Mar 2002 14:34:57 GMT
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message