• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RDB
2
3
4## Overview
5
6The relational database (RDB) store manages data based on relational models. The RDB store provides a complete mechanism for managing local databases based on the underlying SQLite. It provides a series of methods for performing operations, such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements to satisfy different needs in complicated scenarios.
7
8\@SystemCapability.DistributedDataManager.RelationalStore.Core
9
10**Since**
11
1210
13
14
15## Summary
16
17
18### Files
19
20| Name| Description|
21| -------- | -------- |
22| [oh_cursor.h](oh__cursor_8h.md) | Defines the APIs for accessing the result set obtained by querying the RDB store.<br>**File to include**: \<database/rdb/oh_cursor.h><br>**Library**: native_rdb_ndk_header.so |
23| [oh_predicates.h](oh__predicates_8h.md) | Defines the predicates for RDB stores.<br>**File to include**: \<database/rdb/oh_predicates.h><br>**Library**: native_rdb_ndk_header.so |
24| [oh_value_object.h](oh__value__object_8h.md) | Defines type conversion methods.<br>**File to include**: \<database/rdb/oh_value_object.h><br>**Library**: native_rdb_ndk_header.so |
25| [oh_values_bucket.h](oh__values__bucket_8h.md) | Defines the types of the key and value in a key-value (KV) pair.<br>File to include: \<database/rdb/oh_values_bucket.h><br>**Library**: native_rdb_ndk_header.so |
26| [relational_store.h](relational__store_8h.md) | Defines the APIs for managing an RDB store.<br>**File to include**: \<database/rdb/relational_store.h><br>**Library**: native_rdb_ndk_header.so |
27| [relational_store_error_code.h](relational__store__error__code_8h.md) | Declares the error codes used for RDB stores.<br>File to include: \<database/rdb/relational_error_code.h><br>**Library**: native_rdb_ndk_header.so |
28
29
30### Structs
31
32| Name| Description|
33| -------- | -------- |
34| [OH_Cursor](_o_h___cursor.md) | Defines a result set.|
35| [OH_Predicates](_o_h___predicates.md) | Defines a **predicates** object.|
36| [OH_VObject](_o_h___v_object.md) | Defines the allowed data field types.|
37| [OH_VBucket](_o_h___v_bucket.md) | Defines the types of the key and value in a KV pair.|
38| [OH_Rdb_Config](_o_h___rdb___config.md) | Defines the RDB store configuration.|
39| [OH_Rdb_Store](_o_h___rdb___store.md) | Defines the RDB store type.|
40
41
42### Types
43
44| Name| Description|
45| -------- | -------- |
46| [OH_ColumnType](#oh_columntype) | Enumerates the field types in an RDB store.|
47| [OH_Cursor](#oh_cursor) | Indicates a result set.|
48| [OH_OrderType](#oh_ordertype) | Enumerates the sorting types.|
49| [OH_Predicates](#oh_predicates) | Indicates a **predicates** object.|
50| [OH_VObject](#oh_vobject) | Indicates the allowed data field types.|
51| [OH_VBucket](#oh_vbucket) | Indicates the types of the key and value in a KV pair.|
52| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) | Enumerates the RDB store security levels.|
53| [OH_Rdb_ErrCode](#oh_rdb_errcode) | Indicates error codes.|
54
55
56### Enums
57
58| Name| Description|
59| -------- | -------- |
60| [OH_ColumnType](#oh_columntype) {<br>TYPE_NULL = 0, TYPE_INT64, TYPE_REAL, TYPE_TEXT,<br>TYPE_BLOB<br>} | Enumerates the field types in an RDB store.|
61| [OH_OrderType](#oh_ordertype) { ASC = 0, DESC = 1 } | Enumerates the sorting types.|
62| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) { S1 = 1, S2, S3, S4 } | Enumerates the RDB store security levels.|
63| [OH_Rdb_ErrCode](#oh_rdb_errcode) {<br>RDB_ERR = -1, RDB_OK = 0, E_BASE = 14800000, RDB_E_NOT_SUPPORTED = 801,<br>RDB_E_ERROR = E_BASE, RDB_E_INVALID_ARGS = (E_BASE + 1), RDB_E_CANNOT_UPDATE_READONLY = (E_BASE + 2), RDB_E_REMOVE_FILE = (E_BASE + 3),<br>RDB_E_EMPTY_TABLE_NAME = (E_BASE + 5), RDB_E_EMPTY_VALUES_BUCKET = (E_BASE + 6), RDB_E_EXECUTE_IN_STEP_QUERY = (E_BASE + 7), RDB_E_INVALID_COLUMN_INDEX = (E_BASE + 8),<br>RDB_E_INVALID_COLUMN_TYPE = (E_BASE + 9), RDB_E_EMPTY_FILE_NAME = (E_BASE + 10), RDB_E_INVALID_FILE_PATH = (E_BASE + 11), RDB_E_TRANSACTION_IN_EXECUTE = (E_BASE + 12),<br>RDB_E_INVALID_STATEMENT = (E_BASE + 13), RDB_E_EXECUTE_WRITE_IN_READ_CONNECTION = (E_BASE + 14), RDB_E_BEGIN_TRANSACTION_IN_READ_CONNECTION = (E_BASE + 15), RDB_E_NO_TRANSACTION_IN_SESSION = (E_BASE + 16),<br>RDB_E_MORE_STEP_QUERY_IN_ONE_SESSION = (E_BASE + 17), RDB_E_NO_ROW_IN_QUERY = (E_BASE + 18), RDB_E_INVALID_BIND_ARGS_COUNT = (E_BASE + 19), RDB_E_INVALID_OBJECT_TYPE = (E_BASE + 20),<br>RDB_E_INVALID_CONFLICT_FLAG = (E_BASE + 21), RDB_E_HAVING_CLAUSE_NOT_IN_GROUP_BY = (E_BASE + 22), RDB_E_NOT_SUPPORTED_BY_STEP_RESULT_SET = (E_BASE + 23), RDB_E_STEP_RESULT_SET_CROSS_THREADS = (E_BASE + 24),<br>RDB_E_STEP_RESULT_QUERY_NOT_EXECUTED = (E_BASE + 25), RDB_E_STEP_RESULT_IS_AFTER_LAST = (E_BASE + 26), RDB_E_STEP_RESULT_QUERY_EXCEEDED = (E_BASE + 27), RDB_E_STATEMENT_NOT_PREPARED = (E_BASE + 28),<br>RDB_E_EXECUTE_RESULT_INCORRECT = (E_BASE + 29), RDB_E_STEP_RESULT_CLOSED = (E_BASE + 30), RDB_E_RELATIVE_PATH = (E_BASE + 31), RDB_E_EMPTY_NEW_ENCRYPT_KEY = (E_BASE + 32),<br>RDB_E_CHANGE_UNENCRYPTED_TO_ENCRYPTED = (E_BASE + 33), RDB_E_CHANGE_ENCRYPT_KEY_IN_BUSY = (E_BASE + 34), RDB_E_STEP_STATEMENT_NOT_INIT = (E_BASE + 35), RDB_E_NOT_SUPPORTED_ATTACH_IN_WAL_MODE = (E_BASE + 36),<br>RDB_E_CREATE_FOLDER_FAIL = (E_BASE + 37), RDB_E_SQLITE_SQL_BUILDER_NORMALIZE_FAIL = (E_BASE + 38), RDB_E_STORE_SESSION_NOT_GIVE_CONNECTION_TEMPORARILY = (E_BASE + 39), RDB_E_STORE_SESSION_NO_CURRENT_TRANSACTION = (E_BASE + 40),<br>RDB_E_NOT_SUPPORT = (E_BASE + 41), RDB_E_INVALID_PARCEL = (E_BASE + 42), RDB_E_QUERY_IN_EXECUTE = (E_BASE + 43), RDB_E_SET_PERSIST_WAL = (E_BASE + 44),<br>RDB_E_DB_NOT_EXIST = (E_BASE + 45), RDB_E_ARGS_READ_CON_OVERLOAD = (E_BASE + 46), RDB_E_WAL_SIZE_OVER_LIMIT = (E_BASE + 47), RDB_E_CON_OVER_LIMIT = (E_BASE + 48)<br>} | Enumerates the RDB store error codes.|
64
65
66### Functions
67
68| Name| Description|
69| -------- | -------- |
70| [OH_Rdb_CreateValueObject](#oh_rdb_createvalueobject) (void) | Creates an [OH_VObject](_o_h___v_object.md) instance.|
71| [OH_Rdb_CreateValuesBucket](#oh_rdb_createvaluesbucket) (void) | Creates an [OH_VBucket](_o_h___v_bucket.md) instance.|
72| [OH_Rdb_CreatePredicates](#oh_rdb_createpredicates) (const char \*table) | Creates an [OH_Predicates](_o_h___predicates.md) instance.|
73| [OH_Rdb_GetOrOpen](#oh_rdb_getoropen) (const [OH_Rdb_Config](_o_h___rdb___config.md) \*config, int \*errCode) | Obtains an [OH_Rdb_Store](_o_h___rdb___store.md) instance for RDB store operations.|
74| [OH_Rdb_CloseStore](#oh_rdb_closestore) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Destroys an [OH_Rdb_Store](_o_h___rdb___store.md) object and reclaims the memory occupied by the object.|
75| [OH_Rdb_DeleteStore](#oh_rdb_deletestore) (const [OH_Rdb_Config](_o_h___rdb___config.md) \*config) | Deletes an RDB store with the specified database file configuration.|
76| [OH_Rdb_Insert](#oh_rdb_insert) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*table, [OH_VBucket](_o_h___v_bucket.md) \*valuesBucket) | Inserts a row of data into a table.|
77| [OH_Rdb_Update](#oh_rdb_update) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_VBucket](_o_h___v_bucket.md) \*valuesBucket, [OH_Predicates](_o_h___predicates.md) \*predicates) | Updates data in an RDB store based on specified conditions.|
78| [OH_Rdb_Delete](#oh_rdb_delete) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_Predicates](_o_h___predicates.md) \*predicates) | Deletes data from an RDB store based on specified conditions.|
79| [OH_Rdb_Query](#oh_rdb_query) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_Predicates](_o_h___predicates.md) \*predicates, const char \*const \*columnNames, int length) | Queries data in an RDB store based on specified conditions.|
80| [OH_Rdb_Execute](#oh_rdb_execute) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Executes an SQL statement but returns no value.|
81| [OH_Rdb_ExecuteQuery](#oh_rdb_executequery) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Executes the SQL statement to query data in an RDB store.|
82| [OH_Rdb_BeginTransaction](#oh_rdb_begintransaction) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Starts the transaction before executing the SQL statement.|
83| [OH_Rdb_RollBack](#oh_rdb_rollback) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Rolls back the SQL statements executed.|
84| [OH_Rdb_Commit](#oh_rdb_commit) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Commits the executed SQL statements.|
85| [OH_Rdb_Backup](#oh_rdb_backup) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Backs up an RDB store in the specified directory.|
86| [OH_Rdb_Restore](#oh_rdb_restore) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Restores an RDB store from the specified database backup file.|
87| [OH_Rdb_GetVersion](#oh_rdb_getversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int \*version) | Obtains the RDB store version.|
88| [OH_Rdb_SetVersion](#oh_rdb_setversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int version) | Sets the RDB store version.|
89
90
91### Variables
92
93| Name| Description|
94| -------- | -------- |
95| OH_Cursor::id | Unique identifier of the **OH_Cursor** struct.|
96| [OH_Cursor::getColumnCount](#getcolumncount) | Pointer to the function used to obtain the number of columns in the result set.|
97| [OH_Cursor::getColumnType](#getcolumntype) | Pointer to the function used to obtain the column type based on the specified column index.|
98| [OH_Cursor::getColumnIndex](#getcolumnindex) | Pointer to the function used to obtain the column index based on the specified column name.|
99| [OH_Cursor::getColumnName](#getcolumnname) | Pointer to the function used to obtain the column name based on the specified column index.|
100| [OH_Cursor::getRowCount](#getrowcount) | Pointer to the function used to obtain the number of rows in the result set.|
101| [OH_Cursor::goToNextRow](#gotonextrow) | Pointer to the function used to go to the next row of the result set.|
102| [OH_Cursor::getSize](#getsize) | Pointer to the function used to obtain information about the memory required when the column data type in the result set is **BLOB** or **TEXT**.|
103| [OH_Cursor::getText](#gettext) | Pointer to the function used to obtain the value in the form of a string based on the specified column and the current row.|
104| [OH_Cursor::getInt64](#getint64) | Pointer to the function used to obtain the value of the int64_t type based on the specified column and the current row.|
105| [OH_Cursor::getReal](#getreal) | Pointer to the function used to obtain the value of the double type based on the specified column and the current row.|
106| [OH_Cursor::getBlob](#getblob) | Pointer to the function used to obtain the value in the form of a byte array based on the specified column and the current row.|
107| [OH_Cursor::isNull](#isnull-12) | Pointer to the function used to check whether the value in the specified column is null.|
108| [OH_Cursor::destroy](#destroy-14) | Pointer to the function used to close the result set.|
109| [OH_Predicates::id](#id-14) | Unique identifier of the **OH_Predicates** struct.|
110| [OH_Predicates::equalTo](#equalto) | Pointer to the function used to set a predicates object to match the field whose value is equal to the specified value.|
111| [OH_Predicates::notEqualTo](#notequalto) | Pointer to the function used to set a predicates object to match the field whose value is not equal to the specified value.|
112| [OH_Predicates::beginWrap](#beginwrap) | Pointer to the function used to add a left parenthesis to the predicates.|
113| [OH_Predicates::endWrap](#endwrap) | Pointer to the function used to add a right parenthesis to the predicates.|
114| [OH_Predicates::orOperate](#oroperate) | Pointer to the function used to add the OR operator to the predicates.|
115| [OH_Predicates::andOperate](#andoperate) | Pointer to the function used to add the AND operator to the predicates.|
116| [OH_Predicates::isNull](#isnull-22) | Pointer to the function used to set a predicates object to match the field whose value is null.|
117| [OH_Predicates::isNotNull](#isnotnull) | Pointer to the function used to set a predicates object to match the field whose value is not null.|
118| [OH_Predicates::like](#like) | Pointer to the function used to set a predicates object to match a string that is similar to the specified value.|
119| [OH_Predicates::between](#between) | Pointer to the function used to set a predicates object to match the field whose value is within the specified range.|
120| [OH_Predicates::notBetween](#notbetween) | Pointer to the function used to set a predicates object to match the field whose value is out of the specified range.|
121| [OH_Predicates::greaterThan](#greaterthan) | Pointer to the function used to set a predicates object to match the field with value greater than the specified value.|
122| [OH_Predicates::lessThan](#lessthan) | Pointer to the function used to set a predicates object to match the field with value less than the specified value.|
123| [OH_Predicates::greaterThanOrEqualTo](#greaterthanorequalto) | Pointer to the function used to set a predicates object to match the field with value greater than or equal to the specified value.|
124| [OH_Predicates::lessThanOrEqualTo](#lessthanorequalto) | Pointer to the function used to set a predicates object to match the field with value less than or equal to the specified value.|
125| [OH_Predicates::orderBy](#orderby) | Pointer to the function used to set a predicates object to sort the values in a column in ascending or descending order.|
126| [OH_Predicates::distinct](#distinct) | Pointer to the function used to set a predicates object to filter out duplicate records.|
127| [OH_Predicates::limit](#limit) | Pointer to the function used to set a predicates object to specify the maximum number of records.|
128| [OH_Predicates::offset](#offset) | Pointer to the function used to set a predicates object to specify the start position of the returned result.|
129| [OH_Predicates::groupBy](#groupby) | Pointer to the function used to set a predicates object to group rows that have the same value into summary rows.|
130| [OH_Predicates::in](#in) | Pointer to the function used to set a predicates object to match the field with the value within the specified range.|
131| [OH_Predicates::notIn](#notin) | Pointer to the function used to set a predicates object to match the field with the value out of the specified range.|
132| [OH_Predicates::clear](#clear-12) | Pointer to the function used to clear a predicates instance.|
133| [OH_Predicates::destroy](#destroy-24) | Pointer to the function used to destroy an [OH_Predicates](_o_h___predicates.md) object and reclaim the memory occupied. |
134| [OH_VObject::id](#id-24) | Unique identifier of the **OH_VObject** struct.|
135| [OH_VObject::putInt64](#putint64-22) | Pointer to the function used to convert a single parameter or an array of the int64 type into a value of the [OH_VObject](_o_h___v_object.md) type. |
136| [OH_VObject::putDouble](#putdouble) | Pointer to the function used to convert a single parameter or an array of the double type into a value of the [OH_VObject](_o_h___v_object.md) type. |
137| [OH_VObject::putText](#puttext-22) | Pointer to the function used to convert a character array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type. |
138| [OH_VObject::putTexts](#puttexts) | Pointer to the function used to convert a string array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type. |
139| [OH_VObject::destroy](#destroy-44) | Pointer to the function used to destroy an [OH_VObject](_o_h___v_object.md) object and reclaim the memory occupied. |
140| [OH_VBucket::id](#id-34) | Unique identifier of the **OH_VBucket** struct.|
141| [OH_VBucket::capability](#capability) | Number of the KV pairs in the struct.|
142| [OH_VBucket::putText](#puttext-12) | Pointer to the function used to put a char value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. |
143| [OH_VBucket::putInt64](#putint64-12) | Pointer to the function used to put an int64_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. |
144| [OH_VBucket::putReal](#putreal) | Pointer to the function used to put a double value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. |
145| [OH_VBucket::putBlob](#putblob) | Pointer to the function used to put a const uint8_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. |
146| [OH_VBucket::putNull](#putnull) | Pointer to the function used to put a null value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. |
147| [OH_VBucket::clear](#clear-22) | Pointer to the function used to clear an [OH_VBucket](_o_h___v_bucket.md) object. |
148| [OH_VBucket::destroy](#destroy-34) | Pointer to the function used to destroy an [OH_VBucket](_o_h___v_bucket.md) object and reclaim the memory occupied. |
149| [OH_Rdb_Config::selfSize](#selfsize) | Size of the struct.|
150| [OH_Rdb_Config::dataBaseDir](#databasedir) | Path of the database file.|
151| [OH_Rdb_Config::storeName](#storename) | Name of the RDB store.|
152| [OH_Rdb_Config::bundleName](#bundlename) | Bundle name.|
153| [OH_Rdb_Config::moduleName](#modulename) | Module name. |
154| [OH_Rdb_Config::isEncrypt](#isencrypt) | Whether to encrypt the RDB store.|
155| [OH_Rdb_Config::securityLevel](#securitylevel) | Pointer to the function used to set the RDB store security level [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel). |
156| [OH_Rdb_Store::id](#id-44) | Unique identifier of the **OH_Rdb_Store** struct.|
157
158
159## Type Description
160
161
162### OH_ColumnType
163
164```
165typedef enum OH_ColumnType OH_ColumnType
166```
167
168**Description**
169
170Enumerates the field types in an RDB store.
171
172
173### OH_Cursor
174
175```
176typedef struct OH_Cursor OH_Cursor
177```
178
179**Description**
180
181Indicates a result set.
182
183It provides APIs to access the result set obtained by querying the RDB store.
184
185
186### OH_OrderType
187
188```
189typedef enum OH_OrderType OH_OrderType
190```
191
192**Description**
193
194Enumerates the sorting types.
195
196
197### OH_Predicates
198
199```
200typedef struct OH_Predicates OH_Predicates
201```
202
203**Description**
204
205Indicates a **predicates** object.
206
207
208### OH_Rdb_ErrCode
209
210```
211typedef enum OH_Rdb_ErrCode OH_Rdb_ErrCode
212```
213
214**Description**
215
216Indicates an error code.
217
218
219### OH_Rdb_SecurityLevel
220
221```
222typedef enum OH_Rdb_SecurityLevel OH_Rdb_SecurityLevel
223```
224
225**Description**
226
227Enumerates the RDB store security levels.
228
229
230### OH_VBucket
231
232```
233typedef struct OH_VBucket OH_VBucket
234```
235
236**Description**
237
238Indicates the types of the key and value in a KV pair.
239
240
241### OH_VObject
242
243```
244typedef struct OH_VObject OH_VObject
245```
246
247**Description**
248
249Indicates the allowed data field types.
250
251
252## Enum Description
253
254
255### OH_ColumnType
256
257```
258enum OH_ColumnType
259```
260
261**Description**
262
263Enumerates the field types in an RDB store.
264
265| Value| Description|
266| -------- | -------- |
267| TYPE_NULL | NULL type.|
268| TYPE_INT64 | INT64 type.|
269| TYPE_REAL | REAL type.|
270| TYPE_TEXT | TEXT type.|
271| TYPE_BLOB | BLOB type.|
272
273
274### OH_OrderType
275
276```
277enum OH_OrderType
278```
279
280**Description**
281
282Enumerates the sorting types.
283
284| Value| Description|
285| -------- | -------- |
286| ASC | Ascending order.|
287| DESC | Descending order.|
288
289
290### OH_Rdb_ErrCode
291
292```
293enum OH_Rdb_ErrCode
294```
295
296**Description**
297
298Enumerates the error codes.
299
300| Value| Description|
301| -------- | -------- |
302| RDB_ERR | Execution failed.|
303| RDB_OK | Execution successful.|
304| E_BASE | Base of the error code.|
305| RDB_E_NOT_SUPPORTED | The RDB store does not have this capability.|
306| RDB_E_ERROR | Common exception.|
307| RDB_E_INVALID_ARGS | Invalid parameter.|
308| RDB_E_CANNOT_UPDATE_READONLY | Failed to update data because the RDB store is read-only.|
309| RDB_E_REMOVE_FILE | Failed to delete the file.|
310| RDB_E_EMPTY_TABLE_NAME | The table name is empty.|
311| RDB_E_EMPTY_VALUES_BUCKET | The content of the KV pair is empty.|
312| RDB_E_EXECUTE_IN_STEP_QUERY | The SQL statement executed during the query is incorrect.|
313| RDB_E_INVALID_COLUMN_INDEX | The column index is invalid.|
314| RDB_E_INVALID_COLUMN_TYPE | The column type is invalid.|
315| RDB_E_EMPTY_FILE_NAME | The file name is empty.|
316| RDB_E_INVALID_FILE_PATH | The file path is invalid.|
317| RDB_E_TRANSACTION_IN_EXECUTE | Failed to start the transaction.|
318| RDB_E_INVALID_STATEMENT | Failed to precompile the SQL statement.|
319| RDB_E_EXECUTE_WRITE_IN_READ_CONNECTION | Failed to perform a write operation in a read connection.|
320| RDB_E_BEGIN_TRANSACTION_IN_READ_CONNECTION | Failed to start the transaction in a read connection.|
321| RDB_E_NO_TRANSACTION_IN_SESSION | The transaction to start does not exist in the database session.|
322| RDB_E_MORE_STEP_QUERY_IN_ONE_SESSION | Multiple queries are executed in a database session.|
323| RDB_E_NO_ROW_IN_QUERY | The result set does not contain any record.|
324| RDB_E_INVALID_BIND_ARGS_COUNT | The number of parameters bound in the SQL statement is invalid.|
325| RDB_E_INVALID_OBJECT_TYPE | The object type is invalid.|
326| RDB_E_INVALID_CONFLICT_FLAG | The conflict resolution type is invalid.|
327| RDB_E_HAVING_CLAUSE_NOT_IN_GROUP_BY | The HAVING keyword can be used only after GROUP BY.|
328| RDB_E_NOT_SUPPORTED_BY_STEP_RESULT_SET | The result set by step is not supported.|
329| RDB_E_STEP_RESULT_SET_CROSS_THREADS | Failed to obtain the result set.|
330| RDB_E_STEP_RESULT_QUERY_NOT_EXECUTED | The result set query statement is not executed.|
331| RDB_E_STEP_RESULT_IS_AFTER_LAST | The cursor of the result set is already in the last row.|
332| RDB_E_STEP_RESULT_QUERY_EXCEEDED | The number of result set query times exceeds the limit.|
333| RDB_E_STATEMENT_NOT_PREPARED | The SQL statement is not precompiled.|
334| RDB_E_EXECUTE_RESULT_INCORRECT | The database execution result is incorrect.|
335| RDB_E_STEP_RESULT_CLOSED | The result set has been closed.|
336| RDB_E_RELATIVE_PATH | The file path is a relative path.|
337| RDB_E_EMPTY_NEW_ENCRYPT_KEY | The new encrypt key is empty.|
338| RDB_E_CHANGE_UNENCRYPTED_TO_ENCRYPTED | The RDB store is non-encrypted and cannot be changed.|
339| RDB_E_CHANGE_ENCRYPT_KEY_IN_BUSY | The database does not respond when the database key is updated.|
340| RDB_E_STEP_STATEMENT_NOT_INIT | The precompiled SQL statement is not initialized.|
341| RDB_E_NOT_SUPPORTED_ATTACH_IN_WAL_MODE | The WAL mode does not support the ATTACH operation.|
342| RDB_E_CREATE_FOLDER_FAIL | Failed to create the folder.|
343| RDB_E_SQLITE_SQL_BUILDER_NORMALIZE_FAIL | Failed to build the SQL statement.|
344| RDB_E_STORE_SESSION_NOT_GIVE_CONNECTION_TEMPORARILY | The database session does not provide a connection.|
345| RDB_E_STORE_SESSION_NO_CURRENT_TRANSACTION | The transaction does not exist in the database session.|
346| RDB_E_NOT_SUPPORT | The current operation is not supported.|
347| RDB_E_INVALID_PARCEL | The current PARCEL is invalid.|
348| RDB_E_QUERY_IN_EXECUTE | Failed to execute query.|
349| RDB_E_SET_PERSIST_WAL | Failed to set the persistence of the database file in WAL mode.|
350| RDB_E_DB_NOT_EXIST | The database does not exist.|
351| RDB_E_ARGS_READ_CON_OVERLOAD | The number of read connections to set is greater than the limit.|
352| RDB_E_WAL_SIZE_OVER_LIMIT | The WAL log file size exceeds the default value.|
353| RDB_E_CON_OVER_LIMIT | The number of database connections has reached the limit.|
354
355
356### OH_Rdb_SecurityLevel
357
358```
359enum OH_Rdb_SecurityLevel
360```
361
362**Description**
363
364Enumerates the RDB store security levels.
365
366| Value| Description|
367| -------- | -------- |
368| S1 | The security level of the RDB store is low.<br>If data leakage occurs, minor impact will be caused.|
369| S2 | The security level of the RDB store is medium.<br>If data leakage occurs, moderate impact will be caused.|
370| S3 | The security level of the RDB store is high.<br>If data leakage occurs, major impact will be caused.|
371| S4 | The security level of the RDB store is critical.<br>If data leakage occurs, critical impact will be caused.|
372
373
374## Function Description
375
376
377### OH_Rdb_Backup()
378
379```
380int OH_Rdb_Backup (OH_Rdb_Store * store, const char * databasePath )
381```
382
383**Description**
384
385Backs up an RDB store in the specified directory.
386
387**Parameters**
388
389| Name| Description|
390| -------- | -------- |
391| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
392| databasePath | Pointer to the destination directory in which the RDB store is backed up.|
393
394**Returns**
395
396Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
397
398**See**
399
400[OH_Rdb_Store](_o_h___rdb___store.md).
401
402
403### OH_Rdb_BeginTransaction()
404
405```
406int OH_Rdb_BeginTransaction (OH_Rdb_Store * store)
407```
408
409**Description**
410
411Starts the transaction before executing the SQL statement.
412
413**Parameters**
414
415| Name| Description|
416| -------- | -------- |
417| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
418
419**Returns**
420
421Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
422
423**See**
424
425[OH_Rdb_Store](_o_h___rdb___store.md).
426
427
428### OH_Rdb_CloseStore()
429
430```
431int OH_Rdb_CloseStore (OH_Rdb_Store * store)
432```
433
434**Description**
435
436Destroys an [OH_Rdb_Store](_o_h___rdb___store.md) object and reclaims the memory occupied.
437
438**Parameters**
439
440| Name| Description|
441| -------- | -------- |
442| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
443
444**Returns**
445
446Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
447
448**See**
449
450[OH_Rdb_Store](_o_h___rdb___store.md).
451
452
453### OH_Rdb_Commit()
454
455```
456int OH_Rdb_Commit (OH_Rdb_Store * store)
457```
458
459**Description**
460
461Commits the executed SQL statements.
462
463**Parameters**
464
465| Name| Description|
466| -------- | -------- |
467| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
468
469**Returns**
470
471Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
472
473**See**
474
475[OH_Rdb_Store](_o_h___rdb___store.md).
476
477
478### OH_Rdb_CreatePredicates()
479
480```
481OH_Predicates* OH_Rdb_CreatePredicates (const char * table)
482```
483
484**Description**
485
486Creates an [OH_Predicates](_o_h___predicates.md) instance.
487
488**Parameters**
489
490| Name| Description|
491| -------- | -------- |
492| table | Pointer to the name of the database table.|
493
494**Returns**
495
496Returns the pointer to the [OH_Predicates](_o_h___predicates.md) instance created if the operation is successful; returns null otherwise.
497
498**See**
499
500[OH_Predicates](_o_h___predicates.md).
501
502
503### OH_Rdb_CreateValueObject()
504
505```
506OH_VObject* OH_Rdb_CreateValueObject (void)
507```
508
509**Description**
510
511Creates an [OH_VObject](_o_h___v_object.md) instance.
512
513**Returns**
514
515Returns the pointer to the [OH_VObject](_o_h___v_object.md) instance created if the operation is successful; returns null otherwise.
516
517**See**
518
519[OH_VObject](_o_h___v_object.md).
520
521
522### OH_Rdb_CreateValuesBucket()
523
524```
525OH_VBucket* OH_Rdb_CreateValuesBucket (void)
526```
527
528**Description**
529
530Creates an [OH_VBucket](_o_h___v_bucket.md) instance.
531
532**Returns**
533
534Returns the pointer to the [OH_VBucket](_o_h___v_bucket.md) instance created if the operation is successful; returns null otherwise.
535
536**See**
537
538[OH_VBucket](_o_h___v_bucket.md).
539
540
541### OH_Rdb_Delete()
542
543```
544int OH_Rdb_Delete (OH_Rdb_Store * store, OH_Predicates * predicates )
545```
546
547**Description**
548
549Deletes data from an RDB store based on specified conditions.
550
551**Parameters**
552
553| Name| Description|
554| -------- | -------- |
555| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
556| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the deletion conditions.|
557
558**Returns**
559
560Returns the number of affected rows if the operation is successful; returns an error code otherwise.
561
562**See**
563
564[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md).
565
566
567### OH_Rdb_DeleteStore()
568
569```
570int OH_Rdb_DeleteStore (const OH_Rdb_Config * config)
571```
572
573**Description**
574
575Deletes an RDB store with the specified database file configuration.
576
577**Parameters**
578
579| Name| Description|
580| -------- | -------- |
581| path | Pointer to the database path.|
582
583**Returns**
584
585Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
586
587
588### OH_Rdb_Execute()
589
590```
591int OH_Rdb_Execute (OH_Rdb_Store * store, const char * sql )
592```
593
594**Description**
595
596Executes an SQL statement but returns no value.
597
598**Parameters**
599
600| Name| Description|
601| -------- | -------- |
602| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
603| sql | Pointer to the SQL statement to execute.|
604
605**Returns**
606
607Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
608
609**See**
610
611[OH_Rdb_Store](_o_h___rdb___store.md).
612
613
614### OH_Rdb_ExecuteQuery()
615
616```
617OH_Cursor* OH_Rdb_ExecuteQuery (OH_Rdb_Store * store, const char * sql )
618```
619
620**Description**
621
622Executes the SQL statement to query data in an RDB store.
623
624**Parameters**
625
626| Name| Description|
627| -------- | -------- |
628| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
629| sql | Pointer to the SQL statement to execute.|
630
631**Returns**
632
633Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise.
634
635**See**
636
637[OH_Rdb_Store](_o_h___rdb___store.md).
638
639
640### OH_Rdb_GetOrOpen()
641
642```
643OH_Rdb_Store* OH_Rdb_GetOrOpen (const OH_Rdb_Config * config, int * errCode )
644```
645
646**Description**
647
648Obtains an [OH_Rdb_Store](_o_h___rdb___store.md) instance for RDB store operations.
649
650**Parameters**
651
652| Name| Description|
653| -------- | -------- |
654| config | Pointer to the [OH_Rdb_Config](_o_h___rdb___config.md) instance, which specifies the database configuration.|
655| errCode | Function execution status.|
656
657**Returns**
658
659Returns the pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance created if the operation is successful; returns null otherwise.
660
661**See**
662
663[OH_Rdb_Config](_o_h___rdb___config.md), [OH_Rdb_Store](_o_h___rdb___store.md).
664
665
666### OH_Rdb_GetVersion()
667
668```
669int OH_Rdb_GetVersion (OH_Rdb_Store * store, int * version )
670```
671
672**Description**
673
674Obtains the RDB store version.
675
676**Parameters**
677
678| Name| Description|
679| -------- | -------- |
680| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
681| version | Pointer to the version number.|
682
683**Returns**
684
685Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
686
687**See**
688
689[OH_Rdb_Store](_o_h___rdb___store.md).
690
691
692### OH_Rdb_Insert()
693
694```
695int OH_Rdb_Insert (OH_Rdb_Store * store, const char * table, OH_VBucket * valuesBucket )
696```
697
698**Description**
699
700Inserts a row of data into a table.
701
702**Parameters**
703
704| Name| Description|
705| -------- | -------- |
706| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
707| table | Pointer to the target table.|
708| valuesBucket | Pointer to the data [OH_VBucket](_o_h___v_bucket.md) to insert.|
709
710**Returns**
711
712Returns the row ID if the operation is successful; returns an error code otherwise.
713
714**See**
715
716[OH_Rdb_Store](_o_h___rdb___store.md), [OH_VBucket](_o_h___v_bucket.md).
717
718
719### OH_Rdb_Query()
720
721```
722OH_Cursor* OH_Rdb_Query (OH_Rdb_Store * store, OH_Predicates * predicates, const char *const * columnNames, int length )
723```
724
725**Description**
726
727Queries data in an RDB store based on specified conditions.
728
729**Parameters**
730
731| Name| Description|
732| -------- | -------- |
733| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
734| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the query conditions.|
735| columnNames | Pointer to the columns to query. If this parameter is not specified, data of columns will be queried.|
736| length | Length of the **columnNames** array. If <b>length</b> is greater than the length of <b>columnNames</b> array, out-of-bounds access occurs.|
737
738**Returns**
739
740Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise.
741
742**See**
743
744[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md), [OH_Cursor](_o_h___cursor.md).
745
746
747### OH_Rdb_Restore()
748
749```
750int OH_Rdb_Restore (OH_Rdb_Store * store, const char * databasePath )
751```
752
753**Description**
754
755Restores an RDB store from the specified database backup file.
756
757**Parameters**
758
759| Name| Description|
760| -------- | -------- |
761| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
762| databasePath | Pointer to the destination directory in which the RDB store is backed up.|
763
764**Returns**
765
766Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
767
768**See**
769
770[OH_Rdb_Store](_o_h___rdb___store.md).
771
772
773### OH_Rdb_RollBack()
774
775```
776int OH_Rdb_RollBack (OH_Rdb_Store * store)
777```
778
779**Description**
780
781Rolls back the SQL statements executed.
782
783**Parameters**
784
785| Name| Description|
786| -------- | -------- |
787| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
788
789**Returns**
790
791Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
792
793**See**
794
795[OH_Rdb_Store](_o_h___rdb___store.md).
796
797
798### OH_Rdb_SetVersion()
799
800```
801int OH_Rdb_SetVersion (OH_Rdb_Store * store, int version )
802```
803
804**Description**
805
806Sets the RDB store version.
807
808**Parameters**
809
810| Name| Description|
811| -------- | -------- |
812| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
813| version | Pointer to the version number.|
814
815**Returns**
816
817Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
818
819**See**
820
821[OH_Rdb_Store](_o_h___rdb___store.md).
822
823
824### OH_Rdb_Update()
825
826```
827int OH_Rdb_Update (OH_Rdb_Store * store, OH_VBucket * valuesBucket, OH_Predicates * predicates )
828```
829
830**Description**
831
832Updates data in an RDB store based on specified conditions.
833
834**Parameters**
835
836| Name| Description|
837| -------- | -------- |
838| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
839| valuesBucket | Pointer to the new data [OH_VBucket](_o_h___v_bucket.md) to be updated to the table.|
840| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, specifying the update conditions.|
841
842**Returns**
843
844Returns the number of affected rows if the operation is successful; returns an error code otherwise.
845
846**See**
847
848[OH_Rdb_Store](_o_h___rdb___store.md), OH_Bucket, [OH_Predicates](_o_h___predicates.md).
849
850
851## Variable Description
852
853
854### andOperate
855
856```
857OH_Predicates*(* OH_Predicates::andOperate) (OH_Predicates *predicates)
858```
859
860**Description**
861
862Pointer to the function used to add the AND operator to the predicates.
863
864This method is equivalent to **AND** in SQL statements.
865
866**Parameters**
867
868| Name| Description|
869| -------- | -------- |
870| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
871
872**Returns**
873
874Returns the predicates with the AND operator.
875
876**See**
877
878[OH_Predicates](_o_h___predicates.md).
879
880
881### beginWrap
882
883```
884OH_Predicates*(* OH_Predicates::beginWrap) (OH_Predicates *predicates)
885```
886
887**Description**
888
889Pointer to the function used to add a left parenthesis to the predicates.
890
891This method is equivalent to "(" in SQL statements.
892
893**Parameters**
894
895| Name| Description|
896| -------- | -------- |
897| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
898
899**Returns**
900
901Returns the predicates with a left parenthesis.
902
903**See**
904
905[OH_Predicates](_o_h___predicates.md).
906
907
908### between
909
910```
911OH_Predicates*(* OH_Predicates::between) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
912```
913
914**Description**
915
916Pointer to the function used to set a predicates object to match the field whose value is within the specified range.
917
918This method is equivalent to **BETWEEN** in SQL statements.
919
920**Parameters**
921
922| Name| Description|
923| -------- | -------- |
924| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
925| field | Pointer to the column name in the database table.|
926| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
927
928**Returns**
929
930Returns the predicates created.
931
932**See**
933
934[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
935
936### storeName
937
938```
939const char* OH_Rdb_Config::storeName
940```
941
942**Description**
943
944Name of the RDB store.
945
946### bundleName
947
948```
949const char* OH_Rdb_Config::bundleName
950```
951
952**Description**
953
954Application bundle name.
955
956
957### capability
958
959```
960uint16_t OH_VBucket::capability
961```
962
963**Description**
964
965Number of the KV pairs in the struct.
966
967
968### clear [1/2]
969
970```
971OH_Predicates*(* OH_Predicates::clear) (OH_Predicates *predicates)
972```
973
974**Description**
975
976Pointer to the function used to clear a predicates instance.
977
978**Parameters**
979
980| Name| Description|
981| -------- | -------- |
982| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
983
984**Returns**
985
986Returns the cleared predicates.
987
988**See**
989
990[OH_Predicates](_o_h___predicates.md).
991
992
993### clear [2/2]
994
995```
996int(* OH_VBucket::clear) (OH_VBucket *bucket)
997```
998
999**Description**
1000
1001Clears an [OH_VBucket](_o_h___v_bucket.md) object.
1002
1003**Parameters**
1004
1005| Name| Description|
1006| -------- | -------- |
1007| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
1008
1009**Returns**
1010
1011Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1012
1013**See**
1014
1015[OH_VBucket](_o_h___v_bucket.md).
1016
1017
1018### dataBaseDir
1019
1020```
1021const char* OH_Rdb_Config::dataBaseDir
1022```
1023
1024**Description**
1025
1026Path of the database file.
1027
1028
1029### destroy [1/4]
1030
1031```
1032int(* OH_Cursor::destroy) (OH_Cursor *cursor)
1033```
1034
1035**Description**
1036
1037Pointer to the function used to close the result set.
1038
1039**Parameters**
1040
1041| Name| Description|
1042| -------- | -------- |
1043| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1044
1045**Returns**
1046
1047Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1048
1049**See**
1050
1051[OH_Cursor](_o_h___cursor.md).
1052
1053
1054### destroy [2/4]
1055
1056```
1057int(* OH_Predicates::destroy) (OH_Predicates *predicates)
1058```
1059
1060**Description**
1061
1062Destroys an [OH_Predicates](_o_h___predicates.md) object and reclaims the memory occupied.
1063
1064**Parameters**
1065
1066| Name| Description|
1067| -------- | -------- |
1068| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1069
1070**Returns**
1071
1072Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1073
1074**See**
1075
1076[OH_Predicates](_o_h___predicates.md).
1077
1078
1079### destroy [3/4]
1080
1081```
1082int(* OH_VBucket::destroy) (OH_VBucket *bucket)
1083```
1084
1085**Description**
1086
1087Destroys an [OH_VBucket](_o_h___v_bucket.md) object and reclaims the memory occupied.
1088
1089**Parameters**
1090
1091| Name| Description|
1092| -------- | -------- |
1093| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
1094
1095**Returns**
1096
1097Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1098
1099**See**
1100
1101[OH_VBucket](_o_h___v_bucket.md).
1102
1103
1104### destroy [4/4]
1105
1106```
1107int(* OH_VObject::destroy) (OH_VObject *valueObject)
1108```
1109
1110**Description**
1111
1112Destroys an [OH_VObject](_o_h___v_object.md) object and reclaims the memory occupied.
1113
1114**Parameters**
1115
1116| Name| Description|
1117| -------- | -------- |
1118| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
1119
1120**Returns**
1121
1122Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1123
1124**See**
1125
1126[OH_VObject](_o_h___v_object.md).
1127
1128
1129### distinct
1130
1131```
1132OH_Predicates*(* OH_Predicates::distinct) (OH_Predicates *predicates)
1133```
1134
1135**Description**
1136
1137Pointer to the function used to set a predicates object to filter out duplicate records.
1138
1139This method is equivalent to **DISTINCT** in SQL statements.
1140
1141**Parameters**
1142
1143| Name| Description|
1144| -------- | -------- |
1145| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1146
1147**Returns**
1148
1149Returns the predicates created.
1150
1151**See**
1152
1153[OH_Predicates](_o_h___predicates.md).
1154
1155
1156### endWrap
1157
1158```
1159OH_Predicates*(* OH_Predicates::endWrap) (OH_Predicates *predicates)
1160```
1161
1162**Description**
1163
1164Pointer to the function used to add a right parenthesis to the predicates.
1165
1166This method is equivalent to ")" in SQL statements.
1167
1168**Parameters**
1169
1170| Name| Description|
1171| -------- | -------- |
1172| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1173
1174**Returns**
1175
1176Returns the predicates object with a right parenthesis.
1177
1178**See**
1179
1180[OH_Predicates](_o_h___predicates.md).
1181
1182
1183### equalTo
1184
1185```
1186OH_Predicates*(* OH_Predicates::equalTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1187```
1188
1189**Description**
1190
1191Pointer to the function used to set a predicates object to match the field whose value is equal to the specified value.
1192
1193This method is equivalent to "=" in SQL statements.
1194
1195**Parameters**
1196
1197| Name| Description|
1198| -------- | -------- |
1199| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1200| field | Pointer to the column name in the database table.|
1201| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1202
1203**Returns**
1204
1205Returns the predicates created.
1206
1207**See**
1208
1209[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1210
1211
1212### getBlob
1213
1214```
1215int(* OH_Cursor::getBlob) (OH_Cursor *cursor, int32_t columnIndex, unsigned char *value, int length)
1216```
1217
1218**Description**
1219
1220Pointer to the function used to obtain the value in the form of a byte array based on the specified column and the current row.
1221
1222**Parameters**
1223
1224| Name| Description|
1225| -------- | -------- |
1226| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1227| columnIndex | Column index.|
1228| value | Pointer to the value in the form of a byte array obtained.|
1229| length | Length of the value, which can be obtained by **getSize()**.|
1230
1231**Returns**
1232
1233Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1234
1235**See**
1236
1237[OH_Cursor](_o_h___cursor.md).
1238
1239
1240### getColumnCount
1241
1242```
1243int(* OH_Cursor::getColumnCount) (OH_Cursor *cursor, int *count)
1244```
1245
1246**Description**
1247
1248Pointer to the function used to obtain the number of columns in the result set.
1249
1250**Parameters**
1251
1252| Name| Description|
1253| -------- | -------- |
1254| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1255| count | Pointer to the number of columns in the result set obtained.|
1256
1257**Returns**
1258
1259Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1260
1261**See**
1262
1263[OH_Cursor](_o_h___cursor.md).
1264
1265
1266### getColumnIndex
1267
1268```
1269int(* OH_Cursor::getColumnIndex) (OH_Cursor *cursor, const char *name, int *columnIndex)
1270```
1271
1272**Description**
1273
1274Pointer to the function used to obtain the column index based on the specified column name.
1275
1276**Parameters**
1277
1278| Name| Description|
1279| -------- | -------- |
1280| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1281| name | Pointer to the column name in the result set.|
1282| columnIndex | Pointer to the column index obtained.|
1283
1284**Returns**
1285
1286Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1287
1288**See**
1289
1290[OH_Cursor](_o_h___cursor.md).
1291
1292
1293### getColumnName
1294
1295```
1296int(* OH_Cursor::getColumnName) (OH_Cursor *cursor, int32_t columnIndex, char *name, int length)
1297```
1298
1299**Description**
1300
1301Pointer to the function used to obtain the column name based on the specified column index.
1302
1303**Parameters**
1304
1305| Name| Description|
1306| -------- | -------- |
1307| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1308| columnIndex | Column index.|
1309| name | Pointer to the column name obtained.|
1310| length | Length of a column name.|
1311
1312**Returns**
1313
1314Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1315
1316**See**
1317
1318[OH_Cursor](_o_h___cursor.md).
1319
1320
1321### getColumnType
1322
1323```
1324int(* OH_Cursor::getColumnType) (OH_Cursor *cursor, int32_t columnIndex, OH_ColumnType *columnType)
1325```
1326
1327**Description**
1328
1329Pointer to the function used to obtain the column type based on the specified column index.
1330
1331**Parameters**
1332
1333| Name| Description|
1334| -------- | -------- |
1335| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1336| columnIndex | Column index.|
1337| columnType | Pointer to the [OH_ColumnType](#oh_columntype) obtained.|
1338
1339**Returns**
1340
1341Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1342
1343**See**
1344
1345[OH_Cursor](_o_h___cursor.md), [OH_ColumnType](#oh_columntype).
1346
1347
1348### getInt64
1349
1350```
1351int(* OH_Cursor::getInt64) (OH_Cursor *cursor, int32_t columnIndex, int64_t *value)
1352```
1353
1354**Description**
1355
1356Pointer to the function used to obtain the value of the int64_t type based on the specified column and the current row.
1357
1358**Parameters**
1359
1360| Name| Description|
1361| -------- | -------- |
1362| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1363| columnIndex | Column index.|
1364| value | Pointer to the value obtained.|
1365
1366**Returns**
1367
1368Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1369
1370**See**
1371
1372[OH_Cursor](_o_h___cursor.md).
1373
1374
1375### getReal
1376
1377```
1378int(* OH_Cursor::getReal) (OH_Cursor *cursor, int32_t columnIndex, double *value)
1379```
1380
1381**Description**
1382
1383Pointer to the function used to obtain the value of the double type based on the specified column and the current row.
1384
1385**Parameters**
1386
1387| Name| Description|
1388| -------- | -------- |
1389| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1390| columnIndex | Column index.|
1391| value | Pointer to the value obtained.|
1392
1393**Returns**
1394
1395Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1396
1397**See**
1398
1399[OH_Cursor](_o_h___cursor.md).
1400
1401
1402### getRowCount
1403
1404```
1405int(* OH_Cursor::getRowCount) (OH_Cursor *cursor, int *count)
1406```
1407
1408**Description**
1409
1410Pointer to the function used to obtain the number of rows in the result set.
1411
1412**Parameters**
1413
1414| Name| Description|
1415| -------- | -------- |
1416| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1417| count | Pointer to the number of columns in the result set obtained.|
1418
1419**Returns**
1420
1421Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1422
1423**See**
1424
1425[OH_Cursor](_o_h___cursor.md).
1426
1427
1428### getSize
1429
1430```
1431int(* OH_Cursor::getSize) (OH_Cursor *cursor, int32_t columnIndex, size_t *size)
1432```
1433
1434**Description**
1435
1436Pointer to the function used to obtain information about the memory required when the column data type in the result set is **BLOB** or **TEXT**.
1437
1438**Parameters**
1439
1440| Name| Description|
1441| -------- | -------- |
1442| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1443| columnIndex | Column index.|
1444| size | Pointer to the memory size obtained.|
1445
1446**Returns**
1447
1448Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1449
1450**See**
1451
1452[OH_Cursor](_o_h___cursor.md).
1453
1454
1455### getText
1456
1457```
1458int(* OH_Cursor::getText) (OH_Cursor *cursor, int32_t columnIndex, char *value, int length)
1459```
1460
1461**Description**
1462
1463Pointer to the function used to obtain the value in the form of a string based on the specified column and the current row.
1464
1465**Parameters**
1466
1467| Name| Description|
1468| -------- | -------- |
1469| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1470| columnIndex | Column index.|
1471| value | Pointer to the value in the form of a string obtained.|
1472| length | Length of the value, which can be obtained by **getSize()**.|
1473
1474**Returns**
1475
1476Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1477
1478**See**
1479
1480[OH_Cursor](_o_h___cursor.md).
1481
1482
1483### goToNextRow
1484
1485```
1486int(* OH_Cursor::goToNextRow) (OH_Cursor *cursor)
1487```
1488
1489**Description**
1490
1491Pointer to the function used to go to the next row of the result set.
1492
1493**Parameters**
1494
1495| Name| Description|
1496| -------- | -------- |
1497| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1498
1499**Returns**
1500
1501Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1502
1503**See**
1504
1505[OH_Cursor](_o_h___cursor.md).
1506
1507
1508### greaterThan
1509
1510```
1511OH_Predicates*(* OH_Predicates::greaterThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1512```
1513
1514**Description**
1515
1516Pointer to the function used to set a predicates object to match the field with value greater than the specified value.
1517
1518This method is equivalent to "&gt;" in SQL statements.
1519
1520**Parameters**
1521
1522| Name| Description|
1523| -------- | -------- |
1524| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1525| field | Pointer to the column name in the database table.|
1526| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1527
1528**Returns**
1529
1530Returns the predicates created.
1531
1532**See**
1533
1534[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1535
1536
1537### greaterThanOrEqualTo
1538
1539```
1540OH_Predicates*(* OH_Predicates::greaterThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1541```
1542
1543**Description**
1544
1545Pointer to the function used to set a predicates object to match the field with value greater than or equal to the specified value.
1546
1547This method is equivalent to "&gt;=" in SQL statements.
1548
1549**Parameters**
1550
1551| Name| Description|
1552| -------- | -------- |
1553| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1554| field | Pointer to the column name in the database table.|
1555| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1556
1557**Returns**
1558
1559Returns the predicates created.
1560
1561**See**
1562
1563[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1564
1565
1566### groupBy
1567
1568```
1569OH_Predicates*(* OH_Predicates::groupBy) (OH_Predicates *predicates, char const *const *fields, int length)
1570```
1571
1572**Description**
1573
1574Pointer to the function used to set a predicates object to group rows that have the same value into summary rows.
1575
1576This method is equivalent to **GROUP BY** in the SQL statement.
1577
1578**Parameters**
1579
1580| Name| Description|
1581| -------- | -------- |
1582| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1583| fields | Pointer to the names of the columns by which the records are grouped.|
1584| length | Length of the **fields** value.|
1585
1586**Returns**
1587
1588Returns the predicates created.
1589
1590**See**
1591
1592[OH_Predicates](_o_h___predicates.md).
1593
1594
1595### id [1/4]
1596
1597```
1598int64_t OH_Predicates::id
1599```
1600
1601**Description**
1602
1603Unique identifier of the **OH_Predicates** struct.
1604
1605
1606### id [2/4]
1607
1608```
1609int64_t OH_VObject::id
1610```
1611
1612**Description**
1613
1614Unique identifier of the **OH_VObject** struct.
1615
1616
1617### id [3/4]
1618
1619```
1620int64_t OH_VBucket::id
1621```
1622
1623**Description**
1624
1625Unique identifier of the **OH_VBucket** struct.
1626
1627
1628### id [4/4]
1629
1630```
1631int64_t OH_Rdb_Store::id
1632```
1633
1634**Description**
1635
1636Unique identifier of the **OH_Rdb_Store** struct.
1637
1638
1639### in
1640
1641```
1642OH_Predicates*(* OH_Predicates::in) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1643```
1644
1645**Description**
1646
1647Pointer to the function used to set a predicates object to match the field with the value within the specified range.
1648
1649This method is equivalent to **IN** in SQL statements.
1650
1651**Parameters**
1652
1653| Name| Description|
1654| -------- | -------- |
1655| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1656| field | Pointer to the column name in the database table.|
1657| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value range.|
1658
1659**Returns**
1660
1661Returns the predicates created.
1662
1663**See**
1664
1665[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1666
1667
1668### isEncrypt
1669
1670```
1671bool OH_Rdb_Config::isEncrypt
1672```
1673
1674**Description**
1675
1676Whether to encrypt the RDB store.
1677
1678
1679### isNotNull
1680
1681```
1682OH_Predicates*(* OH_Predicates::isNotNull) (OH_Predicates *predicates, const char *field)
1683```
1684
1685**Description**
1686
1687Pointer to the function used to set a predicates object to match the field whose value is not null.
1688
1689This method is equivalent to **IS NOT NULL** in SQL statements.
1690
1691**Parameters**
1692
1693| Name| Description|
1694| -------- | -------- |
1695| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1696| field | Pointer to the column name in the database table.|
1697
1698**Returns**
1699
1700Returns the predicates created.
1701
1702**See**
1703
1704[OH_Predicates](_o_h___predicates.md).
1705
1706
1707### isNull [1/2]
1708
1709```
1710int(* OH_Cursor::isNull) (OH_Cursor *cursor, int32_t columnIndex, bool *isNull)
1711```
1712
1713**Description**
1714
1715Pointer to the function used to check whether the value in the specified column is null.
1716
1717**Parameters**
1718
1719| Name| Description|
1720| -------- | -------- |
1721| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1722| columnIndex | Column index.|
1723| isNull | Pointer to the value returned. The value **true** means the value is null; the value **false** means the opposite.|
1724
1725**Returns**
1726
1727Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
1728
1729**See**
1730
1731[OH_Cursor](_o_h___cursor.md).
1732
1733
1734### isNull [2/2]
1735
1736```
1737OH_Predicates*(* OH_Predicates::isNull) (OH_Predicates *predicates, const char *field)
1738```
1739
1740**Description**
1741
1742Pointer to the function used to set a predicates object to match the field whose value is null.
1743
1744This method is equivalent to **IS NULL** in SQL statements.
1745
1746**Parameters**
1747
1748| Name| Description|
1749| -------- | -------- |
1750| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1751| field | Pointer to the column name in the database table.|
1752
1753**Returns**
1754
1755Returns the predicates created.
1756
1757**See**
1758
1759[OH_Predicates](_o_h___predicates.md).
1760
1761
1762### lessThan
1763
1764```
1765OH_Predicates*(* OH_Predicates::lessThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1766```
1767
1768**Description**
1769
1770Pointer to the function used to set a predicates object to match the field with value less than the specified value.
1771
1772This method is equivalent to "&lt;" in SQL statements.
1773
1774**Parameters**
1775
1776| Name| Description|
1777| -------- | -------- |
1778| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1779| field | Pointer to the column name in the database table.|
1780| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1781
1782**Returns**
1783
1784Returns the predicates created.
1785
1786**See**
1787
1788[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1789
1790
1791### lessThanOrEqualTo
1792
1793```
1794OH_Predicates*(* OH_Predicates::lessThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1795```
1796
1797**Description**
1798
1799Pointer to the function used to set a predicates object to match the field with value less than or equal to the specified value.
1800
1801This method is equivalent to "&lt;=" in SQL statements.
1802
1803**Parameters**
1804
1805| Name| Description|
1806| -------- | -------- |
1807| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1808| field | Pointer to the column name in the database table.|
1809| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1810
1811**Returns**
1812
1813Returns the predicates created.
1814
1815**See**
1816
1817[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1818
1819
1820### like
1821
1822```
1823OH_Predicates*(* OH_Predicates::like) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1824```
1825
1826**Description**
1827
1828Pointer to the function used to set a predicates object to match a string that is similar to the specified value.
1829
1830This method is equivalent to **LIKE** in SQL statements.
1831
1832**Parameters**
1833
1834| Name| Description|
1835| -------- | -------- |
1836| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1837| field | Pointer to the column name in the database table.|
1838| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1839
1840**Returns**
1841
1842Returns the predicates created.
1843
1844**See**
1845
1846[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1847
1848
1849### limit
1850
1851```
1852OH_Predicates*(* OH_Predicates::limit) (OH_Predicates *predicates, unsigned int value)
1853```
1854
1855**Description**
1856
1857Pointer to the function used to set a predicates object to specify the maximum number of records.
1858
1859This method is equivalent to **LIMIT** in SQL statements.
1860
1861**Parameters**
1862
1863| Name| Description|
1864| -------- | -------- |
1865| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1866| value | Maximum number of data records.|
1867
1868**Returns**
1869
1870Returns the predicates created.
1871
1872**See**
1873
1874[OH_Predicates](_o_h___predicates.md).
1875
1876
1877### moduleName
1878
1879```
1880const char* OH_Rdb_Config::moduleName
1881```
1882
1883**Description**
1884
1885Module name.
1886
1887
1888### notBetween
1889
1890```
1891OH_Predicates*(* OH_Predicates::notBetween) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1892```
1893
1894**Description**
1895
1896Pointer to the function used to set a predicates object to match the field whose value is out of the specified range.
1897
1898This method is equivalent to **NOT BETWEEN** in SQL statements.
1899
1900**Parameters**
1901
1902| Name| Description|
1903| -------- | -------- |
1904| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1905| field | Pointer to the column name in the database table.|
1906| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1907
1908**Returns**
1909
1910Returns the predicates created.
1911
1912**See**
1913
1914[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1915
1916
1917### notEqualTo
1918
1919```
1920OH_Predicates*(* OH_Predicates::notEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1921```
1922
1923**Description**
1924
1925Pointer to the function used to set a predicates object to match the field whose value is not equal to the specified value.
1926
1927This method is equivalent to "!=" in SQL statements.
1928
1929**Parameters**
1930
1931| Name| Description|
1932| -------- | -------- |
1933| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1934| field | Pointer to the column name in the database table.|
1935| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.|
1936
1937**Returns**
1938
1939Returns the predicates created.
1940
1941**See**
1942
1943[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1944
1945
1946### notIn
1947
1948```
1949OH_Predicates*(* OH_Predicates::notIn) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
1950```
1951
1952**Description**
1953
1954Pointer to the function used to set a predicates object to match the field with the value out of the specified range.
1955
1956This method is equivalent to **NOT IN** in SQL statements.
1957
1958**Parameters**
1959
1960| Name| Description|
1961| -------- | -------- |
1962| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1963| field | Pointer to the column name in the database table.|
1964| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value range to match.|
1965
1966**Returns**
1967
1968Returns the predicates created.
1969
1970**See**
1971
1972[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
1973
1974
1975### offset
1976
1977```
1978OH_Predicates*(* OH_Predicates::offset) (OH_Predicates *predicates, unsigned int rowOffset)
1979```
1980
1981**Description**
1982
1983Pointer to the function used to set a predicates object to specify the start position of the returned result.
1984
1985This method is equivalent to **OFFSET** in SQL statements.
1986
1987**Parameters**
1988
1989| Name| Description|
1990| -------- | -------- |
1991| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
1992| rowOffset | Start position of the returned result. The value is a positive integer.|
1993
1994**Returns**
1995
1996Returns the predicates created.
1997
1998**See**
1999
2000[OH_Predicates](_o_h___predicates.md).
2001
2002
2003### orderBy
2004
2005```
2006OH_Predicates*(* OH_Predicates::orderBy) (OH_Predicates *predicates, const char *field, OH_OrderType type)
2007```
2008
2009**Description**
2010
2011Pointer to the function used to set a predicates object to sort the values in a column in ascending or descending order.
2012
2013This method is equivalent to **ORDER BY** in the SQL statement.
2014
2015**Parameters**
2016
2017| Name| Description|
2018| -------- | -------- |
2019| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
2020| field | Pointer to the column name in the database table.|
2021| type | Sorting type [OH_OrderType](#oh_ordertype).|
2022
2023**Returns**
2024
2025Returns the predicates created.
2026
2027**See**
2028
2029[OH_Predicates](_o_h___predicates.md), [OH_OrderType](#oh_ordertype).
2030
2031
2032### orOperate
2033
2034```
2035OH_Predicates*(* OH_Predicates::orOperate) (OH_Predicates *predicates)
2036```
2037
2038**Description**
2039
2040Pointer to the function used to add the OR operator to the predicates.
2041
2042This method is equivalent to **OR** in SQL statements.
2043
2044**Parameters**
2045
2046| Name| Description|
2047| -------- | -------- |
2048| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
2049
2050**Returns**
2051
2052Returns the predicates with the OR operator.
2053
2054**See**
2055
2056[OH_Predicates](_o_h___predicates.md).
2057
2058
2059### putBlob
2060
2061```
2062int(* OH_VBucket::putBlob) (OH_VBucket *bucket, const char *field, const uint8_t *value, uint32_t size)
2063```
2064
2065**Description**
2066
2067Puts a const uint8_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
2068
2069**Parameters**
2070
2071| Name| Description|
2072| -------- | -------- |
2073| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
2074| field | Pointer to the column name in the database table.|
2075| value | Pointer to the value to put.|
2076| size | Length of the value.|
2077
2078**Returns**
2079
2080Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2081
2082**See**
2083
2084[OH_VBucket](_o_h___v_bucket.md).
2085
2086
2087### putDouble
2088
2089```
2090int(* OH_VObject::putDouble) (OH_VObject *valueObject, double *value, uint32_t count)
2091```
2092
2093**Description**
2094
2095Converts a single parameter or an array of the double type into a value of the [OH_VObject](_o_h___v_object.md) type.
2096
2097**Parameters**
2098
2099| Name| Description|
2100| -------- | -------- |
2101| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
2102| value | Pointer to the data to covert.|
2103| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
2104
2105**Returns**
2106
2107Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2108
2109**See**
2110
2111[OH_VObject](_o_h___v_object.md).
2112
2113
2114### putInt64 [1/2]
2115
2116```
2117int(* OH_VBucket::putInt64) (OH_VBucket *bucket, const char *field, int64_t value)
2118```
2119
2120**Description**
2121
2122Puts an int64_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
2123
2124**Parameters**
2125
2126| Name| Description|
2127| -------- | -------- |
2128| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
2129| field | Pointer to the column name in the database table.|
2130| value | Value to put.|
2131
2132**Returns**
2133
2134Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2135
2136**See**
2137
2138[OH_VBucket](_o_h___v_bucket.md).
2139
2140
2141### putInt64 [2/2]
2142
2143```
2144int(* OH_VObject::putInt64) (OH_VObject *valueObject, int64_t *value, uint32_t count)
2145```
2146
2147**Description**
2148
2149Converts a single parameter or an array of the int64 type into a value of the [OH_VObject](_o_h___v_object.md) type.
2150
2151**Parameters**
2152
2153| Name| Description|
2154| -------- | -------- |
2155| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
2156| value | Pointer to the data to covert.|
2157| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
2158
2159**Returns**
2160
2161Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2162
2163**See**
2164
2165[OH_VObject](_o_h___v_object.md).
2166
2167
2168### putNull
2169
2170```
2171int(* OH_VBucket::putNull) (OH_VBucket *bucket, const char *field)
2172```
2173
2174**Description**
2175
2176Puts a null value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
2177
2178**Parameters**
2179
2180| Name| Description|
2181| -------- | -------- |
2182| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
2183| field | Pointer to the column name in the database table.|
2184
2185**Returns**
2186
2187Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2188
2189**See**
2190
2191[OH_VBucket](_o_h___v_bucket.md).
2192
2193
2194### putReal
2195
2196```
2197int(* OH_VBucket::putReal) (OH_VBucket *bucket, const char *field, double value)
2198```
2199
2200**Description**
2201
2202Puts a double value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
2203
2204**Parameters**
2205
2206| Name| Description|
2207| -------- | -------- |
2208| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
2209| field | Pointer to the column name in the database table.|
2210| value | Value to put.|
2211
2212**Returns**
2213
2214Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2215
2216**See**
2217
2218[OH_VBucket](_o_h___v_bucket.md).
2219
2220
2221### putText [1/2]
2222
2223```
2224int(* OH_VBucket::putText) (OH_VBucket *bucket, const char *field, const char *value)
2225```
2226
2227**Description**
2228
2229Puts a char value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
2230
2231**Parameters**
2232
2233| Name| Description|
2234| -------- | -------- |
2235| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
2236| field | Pointer to the column name in the database table.|
2237| value | Pointer to the value to put.|
2238
2239**Returns**
2240
2241Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2242
2243**See**
2244
2245[OH_VBucket](_o_h___v_bucket.md).
2246
2247
2248### putText [2/2]
2249
2250```
2251int(* OH_VObject::putText) (OH_VObject *valueObject, const char *value)
2252```
2253
2254**Description**
2255
2256Converts a character array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type.
2257
2258**Parameters**
2259
2260| Name| Description|
2261| -------- | -------- |
2262| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
2263| value | Pointer to the character array to convert.|
2264
2265**Returns**
2266
2267Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2268
2269**See**
2270
2271[OH_VObject](_o_h___v_object.md).
2272
2273
2274### putTexts
2275
2276```
2277int(* OH_VObject::putTexts) (OH_VObject *valueObject, const char **value, uint32_t count)
2278```
2279
2280**Description**
2281
2282Converts a string array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type.
2283
2284**Parameters**
2285
2286| Name| Description|
2287| -------- | -------- |
2288| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
2289| value | Pointer to the string array to convert.|
2290| count | Length of the string array to convert.|
2291
2292**Returns**
2293
2294Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
2295
2296**See**
2297
2298[OH_VObject](_o_h___v_object.md).
2299
2300
2301### securityLevel
2302
2303```
2304int OH_Rdb_Config::securityLevel
2305```
2306
2307**Description**
2308
2309Set the RDB store security level [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel).
2310
2311
2312### selfSize
2313
2314```
2315int OH_Rdb_Config::selfSize
2316```
2317
2318**Description**
2319
2320Size of the struct.
2321