xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changeset_old.3 (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1.Dd December 19, 2018
2.Dt SQLITE3CHANGESET_OLD 3
3.Os
4.Sh NAME
5.Nm sqlite3changeset_old
6.Nd Obtain old.* Values From A Changeset Iterator
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3changeset_old
10.Fa "sqlite3_changeset_iter *pIter"
11.Fa "int iVal"
12.Fa "sqlite3_value **ppValue         "
13.Fc
14.Sh DESCRIPTION
15The pIter argument passed to this function may either be an iterator
16passed to a conflict-handler by sqlite3changeset_apply(),
17or an iterator created by sqlite3changeset_start().
18In the latter case, the most recent call to sqlite3changeset_next()
19must have returned SQLITE_ROW.
20Furthermore, it may only be called if the type of change that the iterator
21currently points to is either SQLITE_DELETE or SQLITE_UPDATE.
22Otherwise, this function returns SQLITE_MISUSE and sets
23*ppValue to NULL.
24.Pp
25Argument iVal must be greater than or equal to 0, and less than the
26number of columns in the table affected by the current change.
27Otherwise, SQLITE_RANGE is returned and *ppValue is set
28to NULL.
29.Pp
30If successful, this function sets *ppValue to point to a protected
31sqlite3_value object containing the iVal'th value from the vector of
32original row values stored as part of the UPDATE or DELETE change and
33returns SQLITE_OK.
34The name of the function comes from the fact that this is similar to
35the "old.*" columns available to update or delete triggers.
36.Pp
37If some other error occurs (e.g.
38an OOM condition), an SQLite error code is returned and *ppValue is
39set to NULL.
40.Sh SEE ALSO
41.Xr sqlite3changeset_apply 3 ,
42.Xr sqlite3changeset_next 3 ,
43.Xr sqlite3changeset_start 3 ,
44.Xr SQLITE_CREATE_INDEX 3 ,
45.Xr SQLITE_OK 3 ,
46.Xr SQLITE_CREATE_INDEX 3
47