<br><br><div class="gmail_quote">On Thu, Oct 1, 2009 at 8:17 PM, YC <span dir="ltr"><<a href="mailto:yinso.chen@gmail.com" target="_blank">yinso.chen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><div class="gmail_quote"><div>jaz/mysql appears to return the last inserted id in its side-effect struct. Until I have it wrapped with the next release - you can retrieve the data by explicitly requiring (require (planet jaz/mysql)) and then use side-effect-insert-id to get the data back.</div>
</div></blockquote><div><br></div><div><br></div><div>Yes, and side-effect-insert-id should be significantly more efficient than SELECT LAST_INSERT_ID(), since the latter involves another round-trip to the DB server.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>
<br>I'll have to think about how to approach this since each database returns different side effects. If anyone have thoughts into this matter please let me know - I would love to hear it. <br><br></div></div></blockquote>
<div><br></div><div><br></div><div>Both Perl's DBI and Java's JDBC have DB-neutral mechanisms for this, but they're very different.</div><div><br></div><div>Perl DBI: <a href="http://search.cpan.org/~timb/DBI/DBI.pm#last_insert_id">http://search.cpan.org/~timb/DBI/DBI.pm#last_insert_id</a></div>
<div>JDBC: <a href="http://www.ibm.com/developerworks/java/library/j-jdbcnew/#keys">http://www.ibm.com/developerworks/java/library/j-jdbcnew/#keys</a></div><div><br></div><div>-Jon</div><div><br></div></div>