cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giuseppe Di Pierri" <>
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

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

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

  <table name="base">
      <key param="id" dbcol="id" type="int" mode="manual"/>
      <value param="myparam" dbcol="...." type="string" />
  <table name="derived">
      <!-- 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"/>
      <value param="..." dbcol="..." type="string" />

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

Thank you in advance for your answer



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