[plt-scheme] bzlib/dbi error trying to insert a null value

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Thu Oct 1 20:36:53 EDT 2009

On Thu, Oct 1, 2009 at 8:17 PM, YC <yinso.chen at gmail.com> wrote:

>
> 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.
>


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.



>
> 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.
>
>

Both Perl's DBI and Java's JDBC have DB-neutral mechanisms for this, but
they're very different.

Perl DBI: http://search.cpan.org/~timb/DBI/DBI.pm#last_insert_id
JDBC: http://www.ibm.com/developerworks/java/library/j-jdbcnew/#keys

-Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20091001/05b6257d/attachment.html>

Posted on the users mailing list.