Content


NTL
Core
CDbUpdate

CDbUpdate


This class provides high level abstraction for update database data operations.

You can find more information in comments below.

class CDbUpdate :public virtual IDbQuery, public CReleasable
{
public:
    CDbUpdate(IDbConnection* connection, IDbStatement *statement, IDbQueryBuilder* qb); // Constructor. "connection" is ignored if "statement" is specified. Either "connection" or "statement" is required. "qb" is required 

    // Query building 
    CDbUpdate* Table(const String& table); // Set table to be updated 
    CDbUpdate* Where(DbCondition condition); // Set delete condition 
    CDbUpdate* Where(const DbConditions &conditions); // Set delete conditions joined by AND operator 
    CDbUpdate* AndWhere(DbCondition condition); // Add delete condition joined by AND operator 
    CDbUpdate* OrWhere(DbCondition condition); // Add delete condition joined by OR operator 
    CDbUpdate* OrderBy(const String& column, const DbOrder& order); // Add ordering column 
    CDbUpdate* OrderBy(const DbOrderByArray& columns); // Add ordering columns 
    CDbUpdate* Limit(const int64& limit = -1); // Set how many record maximum to be deleted. -1 means no limit 

    // Execute 
    void Execute(const StringArray& columns, const DbRow& row); // Execute update of specified columns with specified data. Throw exceptions in case of error 
    void Execute(const DbSet &data); // Execute update of specified columns with specified data. Throw exceptions in case of error 
};
Namespace: nitisa
Include: Nitisa/Db/DbUpdate.h