Sq3LiteC - work with a row … More...
Functions | |
static MK_I32 | Sq3LiteChanges (SQ3_LITE sq3lite) |
Count The Number Of Rows Modified … | |
static MK_I64 | Sq3LiteChanges64 (SQ3_LITE sq3lite) |
Count The Number Of Rows Modified … | |
static void | Sq3LiteSetLastInsertRowid (SQ3_LITE sq3lite, MK_I64 arg1) |
Set the Last Insert Rowid value … | |
static MK_I32 | Sq3LiteTotalChanges (SQ3_LITE sq3lite) |
Total Number Of Rows Modified … | |
static MK_I64 | Sq3LiteTotalChanges64 (SQ3_LITE sq3lite) |
Total Number Of Rows Modified … | |
Sq3LiteC - Sq3LiteC_Row_C_API - function | |
MK_I32 | Sq3LiteChangesP (SQ3_LITE sq3lite) |
Non-inline replacement for Sq3LiteChanges … | |
MK_I64 | Sq3LiteChanges64P (SQ3_LITE sq3lite) |
Non-inline replacement for Sq3LiteChanges64 … | |
void | Sq3LiteSetLastInsertRowidP (SQ3_LITE sq3lite, MK_I64 arg1) |
Non-inline replacement for Sq3LiteSetLastInsertRowid … | |
MK_I32 | Sq3LiteTotalChangesP (SQ3_LITE sq3lite) |
Non-inline replacement for Sq3LiteTotalChanges … | |
MK_I64 | Sq3LiteTotalChanges64P (SQ3_LITE sq3lite) |
Non-inline replacement for Sq3LiteTotalChanges64 … | |
Sq3LiteC - work with a row …
Count The Number Of Rows Modified …
These functions return the number of rows modified, inserted or deleted by the most recently completed INSERT, UPDATE or DELETE statement on the database connection specified by the only parameter. The two functions are identical except for the type of the return value and that if the number of rows modified by the most recent INSERT, UPDATE or DELETE is greater than the maximum value supported by type "int", then the return value of Sq3LiteChanges() is undefined. Executing any other type of SQL statement does not modify the value returned by these functions.
Only changes made directly by the INSERT, UPDATE or DELETE statement are considered - auxiliary changes caused by triggers, foreign key actions or REPLACE constraint resolution are not counted.
Changes to a view that are intercepted by INSTEAD OF triggers are not counted. The value returned by Sq3LiteChanges() immediately after an INSERT, UPDATE or DELETE statement run on a view is always zero. Only changes made to real tables are counted.
Things are more complicated if the Sq3LiteChanges() function is executed while a trigger program is running. This may happen if the program uses the changes() SQL function, or if some other callback function invokes Sq3LiteChanges() directly. Essentially:
Before entering a trigger program the value returned by Sq3LiteChanges() function is saved. After the trigger program has finished, the original value is restored.
This means that if the changes() SQL function (or similar) is used by the first INSERT, UPDATE or DELETE statement within a trigger, it returns the value as set when the calling statement began executing. If it is used by the second or subsequent such statement within a trigger program, the value returned reflects the number of rows modified by the previous INSERT, UPDATE or DELETE statement within the same trigger.
If a separate thread makes changes on the same database connection while Sq3LiteChanges () is running then the value returned is unpredictable and not meaningful.
See also:
Reference code from sqlite3:
Definition at line 502 of file Sq3LiteC_sq3.h.
Count The Number Of Rows Modified …
Definition at line 508 of file Sq3LiteC_sq3.h.
Non-inline replacement for Sq3LiteChanges64 …
Non-inline replacement for Sq3LiteChanges …
Set the Last Insert Rowid value …
The Sq3LiteSetLastInsertRowid(D, R) method allows the application to set the value returned by calling Sq3LiteLastInsertRowid(D) to R without inserting a row into the database.
Reference code from sqlite3:
Definition at line 514 of file Sq3LiteC_sq3.h.
Non-inline replacement for Sq3LiteSetLastInsertRowid …
Total Number Of Rows Modified …
These functions return the total number of rows inserted, modified or deleted by all INSERT, UPDATE or DELETE statements completed since the database connection was opened, including those executed as part of trigger programs. The two functions are identical except for the type of the return value and that if the number of rows modified by the connection exceeds the maximum value supported by type "int", then the return value of Sq3LiteTotalChanges() is undefined. Executing any other type of SQL statement does not affect the value returned by Sq3LiteTotalChanges().
Changes made as part of foreign key actions are included in the count, but those made as part of REPLACE constraint resolution are not. Changes to a view that are intercepted by INSTEAD OF triggers are not counted.
The Sq3LiteTotalChanges (D) interface only reports the number of rows that changed due to SQL statement run against database connection D. Any changes by other database connections are ignored. To detect changes against a database file from other database connections use the PRAGMA data_version command or the SQ3_FCNTL_DATA_VERSION file control.
If a separate thread makes changes on the same database connection while Sq3LiteTotalChanges () is running then the value returned is unpredictable and not meaningful.
See also:
Reference code from sqlite3:
Definition at line 520 of file Sq3LiteC_sq3.h.
Total Number Of Rows Modified …
read more at 'Sq3LiteTotalChanges'
Definition at line 526 of file Sq3LiteC_sq3.h.
Non-inline replacement for Sq3LiteTotalChanges64 …
Non-inline replacement for Sq3LiteTotalChanges …