Re: Beginner question - getting last inserted ID

2001-11-09 Thread William R. Mussatto
On Fri, 9 Nov 2001, Carl Troein wrote: > Date: Fri, 09 Nov 2001 15:41:21 GMT > From: Carl Troein <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: Beginner question - getting last inserted ID > > > Anna Åhnberg writes: > > > Thanks, I actually

Re: Beginner question - getting last inserted ID

2001-11-09 Thread alec . cawley
> Anna Åhnberg writes: > > > Thanks, I actually already found the chapters but now I also now how to > > use the function too! > > Let me quote from the manual: > "LAST_INSERT_ID([expr]) > Returns the last automatically generated value that was > inserted into an AUTO_INCREMENT column.

RE: Beginner question - getting last inserted ID

2001-11-09 Thread Johnson, Gregert
ailto:[EMAIL PROTECTED]] Sent: Friday, November 09, 2001 10:41 AM To: [EMAIL PROTECTED] Subject: Re: Beginner question - getting last inserted ID Anna Åhnberg writes: > Thanks, I actually already found the

Re: Beginner question - getting last inserted ID

2001-11-09 Thread Carl Troein
Anna Åhnberg writes: > Thanks, I actually already found the chapters but now I also now how to > use the function too! Let me quote from the manual: "LAST_INSERT_ID([expr]) Returns the last automatically generated value that was inserted into an AUTO_INCREMENT column. mysql> select L

Re: Beginner question - getting last inserted ID

2001-11-09 Thread Kodrik
> The manual has all the necessary information: > http://www.mysql.com/doc/C/R/CREATE_TABLE.html > http://www.mysql.com/doc/e/x/example-AUTO_INCREMENT.html > > The unofficial FAQ has a chapter on AUTO_INCREMENT: > http://www.bitbybit.dk/mysqlfaq/faq.html#ch6_0_0 > > What you're looking for is prob

Re: Beginner question - getting last inserted ID

2001-11-09 Thread Carl Troein
Anna Åhnberg writes: > When I do an insert in one of these tables the primary key column gets a > new ID. How do I get this ID? I guess I cannot use "SELECT MAX(id) > FROM Table" since old, deleted id's are reused for new rows. > > Please, help me! I shall help you help yourself, for from

Beginner question - getting last inserted ID

2001-11-09 Thread Anna Åhnberg
Hello! I am working on my first MySQL client. I have a number of tables, each containing a AUTO_INCREMENT PRIMARY KEY column. The client is built in Java and using a JDBC-bridge to connect to the database. When I do an insert in one of these tables the primary key column gets a new ID. How do I