List:General Discussion« Previous MessageNext Message »
From:Dehua Yang Date:October 17 2012 7:33am
Subject:Re: Possible to copy the key field to another on INSERT?
View as plain text  
select   LAST_INSERT_ID() ; Under high concurrency  , it would return other
threads value to you.




On Wed, Oct 17, 2012 at 2:23 PM, W. D. <WD@stripped> wrote:

> When creating a record, the first field (KeyField)...
>
>   KeyField        BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
>
> ...is it possible to copy this auto-generated value into
> another field when using the same INSERT that creates the record?
>
> Or would I have to use an UPDATE query using LAST_INSERT_ID()
> immediately after the INSERT statement?
>
> Thanks for any ideas you have.
>
> Start Here to Find It Fast!™ ->
> http://www.US-Webmasters.com/best-start-page/
> $8.77 Domain Names -> http://domains.us-webmasters.com/
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>
>


-- 
B.rgds / Whitepoplar (杨德华)

Thread
Possible to copy the key field to another on INSERT?W. D.17 Oct
Re: Possible to copy the key field to another on INSERT?Dehua Yang17 Oct
  • Re: Possible to copy the key field to another on INSERT?Shawn Green17 Oct
    • Re: Possible to copy the key field to another on INSERT?Dehua Yang17 Oct
Re: Possible to copy the key field to another on INSERT?Claudio Nanni17 Oct
  • Re: Possible to copy the key field to another on INSERT?W. D.17 Oct
  • Re: Possible to copy the key field to another on INSERT?W. D.18 Oct