Esempio n. 1
0
bool KexiDB::SybaseConnection::drv_beforeUpdate(const QString& table, FieldList& fields)
{
    if (fields.autoIncrementFields()->isEmpty())
        return true;

    // explicit update of IDENTITY fields has taken place.
    return drv_executeSQL(QString("SET IDENTITY_UPDATE %1 ON").arg(escapeIdentifier(table)));
}
Esempio n. 2
0
bool KexiDB::SybaseConnection::drv_beforeInsert(const QString& table, FieldList& fields)
{

    if (fields.autoIncrementFields()->isEmpty())
        return true;

    // explicit insertion into IDENTITY fields !!
    return drv_executeSQL(QString("SET IDENTITY_INSERT %1 ON").arg(escapeIdentifier(table)));

}
Esempio n. 3
0
bool KexiDB::SybaseConnection::drv_afterUpdate(const QString& table, FieldList& fields)
{
    // should we instead just set a flag when an identity_update has taken place and only check for that
    // flag here ?

    if (fields.autoIncrementFields()->isEmpty())
        return true;

    // explicit insertion into IDENTITY fields has taken place. Turn off IDENTITY_INSERT
    return drv_executeSQL(QString("SET IDENTITY_UPDATE %1 OFF").arg(escapeIdentifier(table)));

}