1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

feature #200: Remove selecting max oid from template SQL

This commit is contained in:
Tino Vázquez 2010-07-01 13:04:51 +02:00
parent ac3b37767f
commit ef13e81e36

View File

@ -50,19 +50,8 @@ int TemplateSQL::insert_cb(void *nil, int num, char **values, char **names)
int TemplateSQL::insert(SqlDB * db)
{
ostringstream oss;
int rc;
// Get next id from the DB table
set_callback(
static_cast<Callbackable::Callback>(&TemplateSQL::insert_cb));
oss << "SELECT MAX(id) FROM " << table;
rc = db->exec(oss,this);
unset_callback();
if ( rc != 0 )
{
return -1;