First time poster, so please forgive any faux paus
I'm trying to add a record to the end of a table via C/ODBC. As far as I can see, there is no auto increment mechanism, so it looks like I'm going to have to determine the last primary key value, and do my insert with that value + 1.
'SELECT MAX(id)' gives me the result I need, but it consistently takes between 20 and 30 seconds to process the query - which is a bit of a problem. The table in question has around 27,000 rows.
'SELECT TOP n' and 'LIMIT' don't seem to be supported in C/ODBC.
So my question is: does anyone know of an alternative way to get the last row in a table, or determine the highest value of a field, hopefully a quick method than MAX(id)?
I'm running Navision 3.01