getting the next ID

getting the next ID

am 11.05.2007 16:54:12 von Mark Mchugh

Hi,
In oracle there is a function to get the next ID after
the current record, is there such a funtion in mysql?


thanks



____________________________________________________________ ________________________Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: getting the next ID

am 11.05.2007 21:31:41 von Lawson Cronlund

Mark,

If you look up "getlastID" you'll find that this is a per connection
variable which contains the auto-increment value from the last INSERT
command. As I understand it, Oracle provides a ROWID variable associated
with every row of data in the tables. MySQL opted to make this definable by
the designer and provides the information on the value with the getlastID
variable. In general it's a good idea to define a primary key bigint with
automatic increment in every table for the same reasons that Oracle made it
universal.

Googling for "MySQL getlastID" will give you a lot of information as will
looking it up in the MySQL documentation.

Regards,



Lawson Cronlund


-----Original Message-----
From: Mark Mchugh [mailto:mark_mch@yahoo.com]
Sent: Friday, May 11, 2007 7:54 AM
To: mysql list
Subject: getting the next ID

Hi,
In oracle there is a function to get the next ID after
the current record, is there such a funtion in mysql?


thanks



____________________________________________________________ ________________
________Be a better Globetrotter. Get better travel answers from someone who
knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=lawson@vrtinc.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: getting the next ID

am 25.05.2007 00:28:38 von John.Bonnett

The sort of query you run to get this is

SELECT LAST_INSERT_ID();

John Bonnett=20

-----Original Message-----
From: Lawson Cronlund [mailto:lawson@vrtinc.com]=20
Sent: Saturday, 12 May 2007 5:02 AM
To: 'Mark Mchugh'; 'mysql list'
Subject: RE: getting the next ID

Mark,

If you look up "getlastID" you'll find that this is a per connection
variable which contains the auto-increment value from the last INSERT
command. As I understand it, Oracle provides a ROWID variable
associated with every row of data in the tables. MySQL opted to make
this definable by the designer and provides the information on the value
with the getlastID variable. In general it's a good idea to define a
primary key bigint with automatic increment in every table for the same
reasons that Oracle made it universal.

Googling for "MySQL getlastID" will give you a lot of information as
will looking it up in the MySQL documentation.

Regards,



Lawson Cronlund


-----Original Message-----
From: Mark Mchugh [mailto:mark_mch@yahoo.com]
Sent: Friday, May 11, 2007 7:54 AM
To: mysql list
Subject: getting the next ID

Hi,
In oracle there is a function to get the next ID after the current
record, is there such a funtion in mysql?


thanks


=20
____________________________________________________________ ____________
____
________Be a better Globetrotter. Get better travel answers from someone
who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=3Dlist&sid=3D396545469

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dlawson@vrtinc.com



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org