Answer the question
In order to leave comments, you need to log in
Prepared Statements
Hello hackers…
There is a code…
paste2.org/p/2000519
And I can’t understand the situation that it provokes, then I ask you…
If the type in the database is equal to 1, then the first case will work and the record will eventually be deleted with this code:
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXTERNAL_MAIL);
stmt->setUInt32(0, id);
trans->Append(stmt);
} while (result->NextRow());
bool PreparedResultSet::NextRow()
{
/// Only updates the m_rowPosition so upper level code knows in which element
/// of the rows vector to look
if (++m_rowPosition >= m_rowCount)
return false;
return true;
}
Answer the question
In order to leave comments, you need to log in
In my opinion, you misunderstand the code (the problem is somewhere else). Whether the line is removed or not, the loop will still terminate. Records are not deleted from the result (result) during the execution of the loop body (even if SQL with DELETE is added to the transaction). But the next time the SendExternalMails method is called, the rows will be selected again and again fall into the result if they were not deleted earlier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question