Bug / CPU issue with LAST_INSERT_ID()
Posted: Sat 25 Jun 2005 17:07
I was wondering if anyone else had had a problem with a query on LAST_INSERT_ID(). When I execute the following C++ code it will work, but when execution reaches the Query->Open() the CPU load jumps to 100% and it takes about 5 seconds to complete. It seems only to happen on this table, but is not an isolated event - I have seen it in other sections of my code where LAST_INSERT_ID() is used.
Thanks in anticipation ...
[/code]
Thanks in anticipation ...
Code: Select all
TMyQuery* Query2 = new TMyQuery(0);
Query->Connection = MyDBSession;
Query->SQL->Clear();
Query->SQL->Add( "select"
" LAST_INSERT_ID() SeqNo"
" from txqueue" );
Query->Open();
if ( !Query->Eof )
SeqNo = Query->FieldByName( "SeqNo" )->AsInteger;