world.DatabaseTotalChanges

MUSHclient script function (Method) — introduced in version 4.40

Returns a count of the total changes to the database

Prototype

long DatabaseTotalChanges(BSTR DbName);

Data type meanings

Description

This function returns the number of row changes caused by INSERT, UPDATE or DELETE statements since the database connection was opened. The count includes all changes from all trigger contexts. However, the count does not include changes used to implement REPLACE constraints, do rollbacks or ABORT processing, or DROP table processing. The changes are counted as soon as the statement that makes them is completed (when the statement handle is passed to DatabaseReset or DatabaseFinalize).

Lua example

changes = DatabaseTotalChanges ("db")

Return value

A positive integer, or zero, indicating the count of changes.

Otherwise:

-1 : Database id not found
-2 : Database not open

Related topic

Database (SQLite)

See also

FunctionDescription
DatabaseChangesReturns a count of the changes to the database by the most recent SQL statement
DatabaseExecExecutes SQL code against an SQLite database
DatabaseLastInsertRowidReturns the most recently automatically allocated database key
DatabaseStepExecutes a previously-prepared SQL statement