Re: @@identity

2004-03-10 Thread Daniel Kasak
Aaron wrote: How can I select the last record that was inserted? An ASP/VB example would be great too! I believe you have it already. I use: select last_insert_id() as MyID but from memory @@identity is a synonym of last_insert_id() Dan -- sig Daniel Kasak IT Developer NUS

Re: @@identity

2004-03-10 Thread Rocar Peças
My Aaron, I don´t know any means to get the last inserted record into a MySQL table, as built-in command. What I would do to get this record is to have a timestamp field in the record (mmddmilisecsinday) to solve the problem. That´s it. Leandro Neves. - Original Message - From:

RE: @@identity

2004-03-10 Thread Victor Pendleton
Rough example. Assuming that you are using the same connection since last_insert_id() is connection specific. rset.open INSERT INTO table1 values(someValue) rset.open SELECT last_insert_id() as identity identity = rset.fields(identity) -Original Message- From: Aaron To: [EMAIL

RE: @@identity

2004-03-10 Thread Aaron
Great - thanks! -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: March 10, 2004 5:36 PM To: 'Aaron '; '[EMAIL PROTECTED] ' Subject: RE: @@identity Rough example. Assuming that you are using the same connection since last_insert_id() is connection specific

Re: IDENTITY column

2003-12-23 Thread Matt Fuller
Hi, I think what you need is an auto increment (primary key) column. When a record is inserted, it will automatically generate the next number in the sequence. Being a primary key, the column must be unique (i.e no two rows can be the same), so you can identify a specify record in the table.

RE: @@identity

2003-06-18 Thread Carter, Scott
This may not be the correct solution exactly, but what I do to ensure that I get the correct ID back is the following: I know what I just inserted, therefore I can use this information in a WHERE clause to ensure retrieving the correct ID. Example: INSERT name='scott', age=20 into

RE: @@identity

2003-06-18 Thread Twibell, Cory L
: Wednesday, June 18, 2003 12:59 PM To: 'Jonas Geiregat'; 'Mysql' Subject: RE: @@identity This may not be the correct solution exactly, but what I do to ensure that I get the correct ID back is the following: I know what I just inserted, therefore I can use this information in a WHERE clause to ensure

Re: @@identity

2003-06-18 Thread Eric Calvert
On Wednesday 18 June 2003 13:59, Carter, Scott wrote: This may not be the correct solution exactly, but what I do to ensure that I get the correct ID back is the following: I know what I just inserted, therefore I can use this information in a WHERE clause to ensure retrieving the correct ID.

RE: @@identity

2003-06-18 Thread Jennifer Goodie
One should always use the LAST_INSERT_ID() or after an insert, select max(id) from myTable. Select max(id) from myTable should never be used to get the last insert id. On a high traffic table you are not guaranteed it will be the ID for the record you just inserted, another could have been

Re: @@identity

2003-06-18 Thread Don Read
On 18-Jun-2003 Jonas Geiregat wrote: I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy sometimes slow .. is

Re: @@identity

2003-06-18 Thread Jonas Geiregat
Don Read wrote: On 18-Jun-2003 Jonas Geiregat wrote: I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy sometimes

Re: @@IDENTITY

2002-06-21 Thread Arul
Even the last_insert_id() returns 0 is it coz the table type is INNODB - Original Message - From: Jan Peuker [EMAIL PROTECTED] To: Arul [EMAIL PROTECTED] Sent: Friday, June 21, 2002 4:16 PM Subject: Re: @@IDENTITY You are using M$-Syntax, in MySQL you should use: SELECT

Re: @@IDENTITY

2002-06-21 Thread Tod Harter
Subject: Re: @@IDENTITY You are using M$-Syntax, in MySQL you should use: SELECT last_insert_id() http://www.mysql.com/doc/e/x/example-AUTO_INCREMENT.html regards, jan - Original Message - From: Arul To: MySQL Sent: Friday, June 21, 2002 12:17 PM Subject

RE: @@IDENTITY

2002-05-29 Thread Venu
-Original Message- From: Richard Davidson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:31 PM To: MySql List; [EMAIL PROTECTED] Subject: FYI: @@IDENTITY I don't know if this is just weirdness on my system but I thought I would pass this on in case anyone runs