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:
parent
ac3b37767f
commit
ef13e81e36
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user