can you clarify, please, this statement from docs
If your query returns multiple result sets, for example, a procedure call on MySQL that returns results, you must lock both the query and the entire fetch operation. SourceMod is only able to fetch one result set at a time, and all result sets must be cleared before a new query is started.
Can you show / explain example of such multiple result set?
Sample from docs:
bool GetByAge_Query(Database db, int age)
FormatEx(query, sizeof(query), "SELECT name FROM users WHERE age = %d", age);
DBResultSet hQuery = SQL_Query(db, query);
if (hQuery == null)
void PrintResults(Handle query)
/* Even if we have just one row, you must call SQL_FetchRow() first */
SQL_FetchString(query, 0, name, sizeof(name));
PrintToServer("Name \"%s\" was found.", name);
Do I correctly understand, if SQL_Query
returns more than one row (such a way several calls to SQL_FetchRow
will be required), in such case I should also move SQL_UnlockDatabase
below the PrintResults