On Fri, 24 Aug 2007, Michael Dykman wrote:
calculating the max key + 1 , as it has been noted, must be done
transactionally and will therefore require a transactional table
And with a transaction isolation level greater than Read Commited...
-r
--
MySQL General Mailing List
For list archives
On 8/24/07, hardc0d3r <[EMAIL PROTECTED]> wrote:
>
> yup, that's it.. thanks for the reply..
> --
More typically, you would use the last_insert_id() function which will
return the value of the most recently created auto-increment key...
CREATE TABLE mytable (
id int auto_increment primary key,
f
> >> what if i need the primary key of a row that is to be inserted? that
> > primary
> >> key will be used to insert another row from another table.. what i
> >> was
> > doing
> >> was after inserting the row, i get the primary key by select
> &
yup, that's it.. thanks for the reply..
--
View this message in context:
http://www.nabble.com/what-if-i-need-the-primary-key-of-a-row-that-is-to-be-inserted--tf4323900.html#a12313942
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For
>
> what if i need the primary key of a row that is to be inserted? that
primary
> key will be used to insert another row from another table.. what i was
doing
> was after inserting the row, i get the primary key by select statement and
> use that value to insert a row from ano
what if i need the primary key of a row that is to be inserted? that primary
key will be used to insert another row from another table.. what i was doing
was after inserting the row, i get the primary key by select statement and
use that value to insert a row from another table.. is this ok? are