xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3changeset_new.3 (revision 022f005200bc25af02826a05c8d86d0ef18232dc)
1.Dd March 11, 2017
2.Dt SQLITE3CHANGESET_NEW 3
3.Os
4.Sh NAME
5.Nm sqlite3changeset_new
6.Nd Obtain new.* Values From A Changeset Iterator
7.Sh SYNOPSIS
8.Ft int
9.Fo sqlite3changeset_new
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_UPDATE or SQLITE_INSERT.
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
32new row values stored as part of the UPDATE or INSERT change and returns
33SQLITE_OK.
34If the change is an UPDATE and does not include a new value for the
35requested column, *ppValue is set to NULL and SQLITE_OK returned.
36The name of the function comes from the fact that this is similar to
37the "new.*" columns available to update or delete triggers.
38.Pp
39If some other error occurs (e.g.
40an OOM condition), an SQLite error code is returned and *ppValue is
41set to NULL.
42.Sh SEE ALSO
43.Xr sqlite3changeset_apply 3 ,
44.Xr sqlite3changeset_next 3 ,
45.Xr sqlite3changeset_start 3 ,
46.Xr SQLITE_CREATE_INDEX 3 ,
47.Xr SQLITE_OK 3 ,
48.Xr SQLITE_CREATE_INDEX 3
49