List:MySQL and Java« Previous MessageNext Message »
From:Mark Matthews Date:January 8 2003 3:31am
Subject:Re: retrieving auto-generated keys on bulk insert
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dane Foster wrote:
> Hi Mark.
> 
> The Connector/J JDBC driver does not correctly handle returning auto-generated
> keys on multi row inserts.  I'm not sure if this is a bug because the multi row
> INSERT syntax in MySQL is MySQL specific therefore the JDBC rules may not apply.
> On the other hand, the ANSI/ISO SQL standard supports multi row inserts, and
> since the JDBC API is geared towards the ANSI/ISO SQL standard maybe the JDBC
> rules do apply and it is indeed a bug.
> 
> Let my back up for a moment and clarify in case I lost anyone.  Lets pretend we
> have a database table named 'MY_TABLE' that looks something like this:
[snip]

This is covered in the MySQL manual:

http://www.mysql.com/doc/en/Miscellaneous_functions.html

(see the 'last_insert_id()' function section)

The server does not currently make these values available to _any_ 
client library.

	-Mark
- -- 
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

     __  ___     ___ ____  __
    /  |/  /_ __/ __/ __ \/ /  Mark Matthews <mark@stripped>
   / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
  /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
         <___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+G42atvXNTca6JD8RAmK0AJ48AtHo/oVL6D8ReWRFFYk+gprfugCeI2Pr
Fbzc9a5VlMHBOf+adxz140Y=
=rqeF
-----END PGP SIGNATURE-----

Thread
retrieving auto-generated keys on bulk insertDane Foster8 Jan
  • Re: retrieving auto-generated keys on bulk insertMark Matthews8 Jan
  • Re: retrieving auto-generated keys on bulk insertPaul DuBois8 Jan
  • Re: retrieving auto-generated keys on bulk insertDane Foster8 Jan
    • Re: retrieving auto-generated keys on bulk insertMark Matthews8 Jan
    • Re: retrieving auto-generated keys on bulk insertPaul DuBois8 Jan
  • Re: retrieving auto-generated keys on bulk insertChristopher Taylor8 Jan
  • Re: retrieving auto-generated keys on bulk insertJeff Mathis8 Jan
  • Re: retrieving auto-generated keys on bulk insertDane Foster8 Jan
  • Re: retrieving auto-generated keys on bulk insertDane Foster8 Jan
  • Re: retrieving auto-generated keys on bulk insertJeff Mathis8 Jan
  • Re: retrieving auto-generated keys on bulk insertDane Foster8 Jan
    • Re: retrieving auto-generated keys on bulk insertPaul DuBois8 Jan
  • Re: retrieving auto-generated keys on bulk insertJeff Mathis8 Jan
    • Re: retrieving auto-generated keys on bulk insertTim Endres9 Jan
  • Re: retrieving auto-generated keys on bulk insertDane Foster8 Jan