Agreed, however, my question was, is "@@IDENTITY" recognized by mySQL, I
just need to create something that can be easily convertible from MS-SQL to
mySQL, etc. and so each difference needs to be documented.
-----Original Message-----
From: Dana Powers [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 5:04 PM
To: Dave Carter; [EMAIL PROTECTED]
Subject: Re: Last Inserted Record Question
LAST_INSERT_ID() is similar. It will give you the value for autoincrement
fields. Note that this is connection dependent ( so your last_insert_id() is
not the same as my last_insert_id() ). You would do something like this:
INSERT INTO tablex ( columnx ) VALUES ( 'valuex' );
INSERT INTO tabley ( tablex_id, columny ) VALUES ( LAST_INSERT_ID(),
'valuey' );
There are some caveats, of course, so check the great online documentation
at www.mysql.com/docs. Search for autoincrement or last_insert_id()
dpk
----- Original Message -----
From: "Dave Carter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 1:24 PM
Subject: Last Inserted Record Question
> Access and MS-SQL Server have a method called @@IDENTITY used in
retrieving
> the last inserted ID of a recordset. Is mySQL ok with that command. I
> suppose I could try it, but I'm interested in views etc. also.
>
>
> Dave Carter
> Chief Web Architect
> Accelerated Business Technologies, Inc.
> http://www.abti.net
> 717.464.2970
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php