2011/1/21 Jerry Schwartz <je...@gii.co.jp>:
>>-----Original Message-----
>>From: João Cândido de Souza Neto [mailto:j...@consultorweb.cnt.br]
>>Sent: Friday, January 21, 2011 12:47 PM
>>To: mysql@lists.mysql.com
>>Subject: Re: CURRENT insert ID
>>
>>Ok, you must have your own reasons to do that.
>>
>>The fact is: You can´t set the auto_incremente value field to another field
>>in the same table and record even in a trigger.
>>
>>So, the best way is a second update.
>>
> [JS] That's what I'm trying to do now, but I'm using MS Access through an ODBC
> connection and I haven't figured out how to retrieve last_insert_id.

I will tell you a secret. But shhhhhhhhhh. Do not tell anyone:

------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------
mysql> create table mytable(id int auto_increment primary key, name
varchar(255));
Query OK, 0 rows affected (0.07 sec)

mysql> insert into mytable (name) values ('test data');
Query OK, 1 row affected (0.00 sec)

mysql> select id from mytable where id is null;  -- OMG!!!
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.00 sec)
------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------


-- 
Jaime Crespo
MySQL & Java Instructor
Software Developer
Warp Networks
<http://warp.es>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to