-none- 2007-09-03 - By Alex Burton
Back Martin
After inserting the new row in a table with an AUTO_INCREMENT field, call mysqlpp::Connection::insert_id() to get the value of the AUTO_INCREMENT in your new row.
Alex
On 03/09/2007, at 6:40 PM, Martin Dommermuth wrote:
> Hi, > > I suppose this is somewhere in the docs, but I can't find a sane way > to search for it. So please s.o. hit me with a cluestick: > > I have this code: > readoutTemplate = "insert into readout values "; > readoutTemplate.append("(%0, %1q, %2, %3, "); > readoutTemplate.append("%4, %5, %6, %7, %8, %9, %10, %11, %12q)"); > > ubisenseTemplate = "insert into ubisense values "; > ubisenseTemplate.append("(%0, %1, %2, %3, %4, %5q, %6q)"); > > Column one of readout is AUTO_INCREMENT and ubisense has a > FOREIGN KEY (idreadout) REFERENCES readout(id). > How can I get the ID the new row will have? Should I use SSQLS > instead? > > Thanks, > > Martin > > > > -- > MySQL++ Mailing List > For list archives: http://lists.mysql.com/plusplus > To unsubscribe: http://lists.mysql.com/plusplus? > unsub=alexibu@(protected) >
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=mysql@(protected)
|
|