• 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 system provides mechanisms for local database management based on the underlying SQLite. You can use methods to perform operations, such as adding, deleting, modifying, and querying data, and directly executing SQL statements to satisfy different needs in complicated scenarios.
7
8**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
9
10**Since**: 10
11
12
13## Summary
14
15
16### Files
17
18| Name| Description|
19| -------- | -------- |
20| [oh_cursor.h](oh__cursor_8h.md) | Defines APIs for accessing the result set obtained by querying an RDB store.<br>**File to include**: <database/rdb/oh_cursor.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
21| [oh_data_value.h](oh__data__value_8h.md) | Defines APIs and enums related to a single data value.<br>Since API version 18, **OH_ColumnType** is moved from **oh_cursor.h** to this file. This type is supported in versions earlier than API version 18 and can be used in all versions.<br>**File to include**: <database/rdb/oh_data_value.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
22| [oh_data_values.h](oh__data__values_8h.md) | Defines APIs and enums related to multiple data values.<br>**File to include**: <database/rdb/oh_data_values.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
23| [oh_data_values_buckets.h](oh__data__values__buckets_8h.md) | Defines structs, APIs, and enums related to stored data values.<br>**File to include**: <database/rdb/oh_data_values_buckets.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
24| [oh_predicates.h](oh__predicates_8h.md) | Defines the predicates for RDB store operations.<br>**File to include**: <database/rdb/oh_predicates.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
25| [oh_rdb_transaction.h](oh__rdb__transaction_8h.md) | Defines APIs and enums related to transactions.<br>**File to include**: <database/rdb/oh_rdb_transaction.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
26| [oh_rdb_types.h](oh__rdb__types_8h.md) | Defines types related to data values.<br>**File to include**: <database/rdb/oh_rdb_types.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
27| [oh_value_object.h](oh__value__object_8h.md) | Defines the APIs for type conversion.<br>**File to include**: <database/rdb/oh_value_object.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
28| [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**: libnative_rdb_ndk.z.so<br>|
29| [relational_store.h](relational__store_8h.md) | Provides APIs for managing data in an RDB store. The APIs not marked as supporting vector stores are available only to RDB stores.<br>**File to include**: <database/rdb/relational_store.h><br>**Library**: libnative_rdb_ndk.z.so<br>|
30| [relational_store_error_code.h](relational__store__error__code_8h.md) | Defines the error codes used for RDB stores.<br>**File to include**: <database/rdb/relational_store_error_code.h><br>**Library**: libnative_rdb_ndk.z.so|
31
32
33### Structs
34
35| Name| Description|
36| -------- | -------- |
37| [OH_Cursor](_o_h___cursor.md) | Defines a result set.|
38| [OH_Predicates](_o_h___predicates.md) | Defines a **predicates** object.|
39| [OH_VObject](_o_h___v_object.md) | Defines the allowed data types of the fields.|
40| [OH_VBucket](_o_h___v_bucket.md) | Defines the types of the key and value in a KV pair.|
41| [OH_Rdb_Config](_o_h___rdb___config.md) | Defines the configuration of an RDB store.|
42| [OH_Rdb_Store](_o_h___rdb___store.md) | Defines the RDB store type.|
43| [Rdb_DistributedConfig](_rdb___distributed_config.md) | Defines the distributed configuration of a table.|
44| [Rdb_KeyInfo](_rdb___key_info.md) | Defines the primary key or number of the row changed.|
45| [Rdb_KeyInfo::Rdb_KeyData](union_rdb___key_info_1_1_rdb___key_data.md) | Defines the changed data.|
46| [Rdb_ChangeInfo](_rdb___change_info.md) | Defines the details about the device-cloud sync process.|
47| [Rdb_SubscribeCallback](union_rdb___subscribe_callback.md) | Defines a callback used to return the subscribed event.|
48| [Rdb_DataObserver](_rdb___data_observer.md) | Defines the data observer.|
49| [Rdb_Statistic](_rdb___statistic.md) | Defines the device-cloud sync statistics of a table.|
50| [Rdb_TableDetails](_rdb___table_details.md) | Defines the statistics of device-cloud upload and download tasks of a table.|
51| [Rdb_ProgressDetails](_rdb___progress_details.md) | Defines the statistics of the overall device-cloud sync (upload and download) tasks of an RDB store.|
52| [Rdb_ProgressObserver](_rdb___progress_observer.md) | Defines the observer of the device-cloud sync progress.|
53
54
55### Macros
56
57| Name| Description|
58| -------- | -------- |
59| [DISTRIBUTED_CONFIG_VERSION](#distributed_config_version)&nbsp;&nbsp;&nbsp;1 | Version of [Rdb_DistributedConfig](_rdb___distributed_config.md).|
60| [DISTRIBUTED_CHANGE_INFO_VERSION](#distributed_change_info_version)&nbsp;&nbsp;&nbsp;1 | Version of [Rdb_ChangeInfo](_rdb___change_info.md).|
61| [DISTRIBUTED_PROGRESS_DETAIL_VERSION](#distributed_progress_detail_version)&nbsp;&nbsp;&nbsp;1 | Version of [Rdb_ProgressDetails](_rdb___progress_details.md).|
62
63
64### Types
65
66| Name| Description|
67| -------- | -------- |
68| typedef enum [Rdb_ConflictResolution](#rdb_conflictresolution) [Rdb_ConflictResolution](#rdb_conflictresolution) | Defines an enum for conflict resolution policies.|
69| typedef struct [OH_Rdb_ConfigV2](#oh_rdb_configv2) [OH_Rdb_ConfigV2](#oh_rdb_configv2) | Defines a struct for the RDB store configuration. Different from [OH_Rdb_Config](_o_h___rdb___config.md), this struct does not expose its member variables externally. Methods are used to configure the properties of this struct. It supports vector stores.|
70| typedef enum [Rdb_DBType](#rdb_dbtype) [Rdb_DBType](#rdb_dbtype) | Defines an enum for database kernel types.|
71| typedef enum [Rdb_Tokenizer](#rdb_tokenizer) [Rdb_Tokenizer](#rdb_tokenizer) | Defines an enum for database tokenizer types.|
72| typedef enum [OH_ColumnType](#oh_columntype) [OH_ColumnType](#oh_columntype) | Defines an enum for column types.|
73| typedef struct [OH_Data_Value](#oh_data_value) [OH_Data_Value](#oh_data_value) | Defines the [OH_Data_Value](#oh_data_value) struct.|
74| typedef struct [OH_Data_Values](#oh_data_values) [OH_Data_Values](#oh_data_values) | Defines the [OH_Data_Values](#oh_data_values) struct.|
75| typedef struct [OH_Data_VBuckets](#oh_data_vbuckets) [OH_Data_VBuckets](#oh_data_vbuckets) | Defines the **OH_Data_VBuckets** struct.|
76| typedef enum [OH_RDB_TransType](#oh_rdb_transtype) [OH_RDB_TransType](#oh_rdb_transtype) | Defines an enum for transaction types of an RDB store.|
77| typedef struct [OH_RDB_TransOptions](#oh_rdb_transoptions) [OH_RDB_TransOptions](#oh_rdb_transoptions) | Defines the [OH_RDB_TransOptions](#oh_rdb_transoptions) struct.|
78| typedef struct [OH_Rdb_Transaction](#oh_rdb_transaction) [OH_Rdb_Transaction](#oh_rdb_transaction) | Defines the [OH_Rdb_Transaction](#oh_rdb_transaction) struct.|
79| [OH_Cursor](#oh_cursor) | Defines a struct for a result set.|
80| [OH_OrderType](#oh_ordertype) | Defines an enum for sorting types.|
81| [OH_Predicates](#oh_predicates) | Defines a **predicates** object.|
82| [OH_VObject](#oh_vobject) | Defines a struct for allowed data field types.|
83| [OH_VBucket](#oh_vbucket) | Defines a struct for the types of the key and value in a KV pair.|
84| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) | Defines an enum for RDB store security levels.|
85| [Rdb_SecurityArea](#rdb_securityarea) | Defines an enum for encryption levels of database files.|
86| [Rdb_DistributedType](#rdb_distributedtype) | Defines an enum for distributed types.|
87| [Rdb_DistributedConfig](#rdb_distributedconfig) | Defines a struct for distributed configuration of a table.|
88| [Rdb_ChangeType](#rdb_changetype) | Defines an enum for data change types.|
89| [Rdb_KeyInfo](#rdb_keyinfo) | Defines a struct for the primary key or number of the row that changes.|
90| [Rdb_ChangeInfo](#rdb_changeinfo) | Defines a struct for the details about the device-cloud sync process.|
91| [Rdb_SubscribeType](#rdb_subscribetype) | Defines an enum for subscription types.|
92| [Rdb_BriefObserver](#rdb_briefobserver) | Defines a callback used to return the device-cloud data change event.|
93| [Rdb_DetailsObserver](#rdb_detailsobserver) | Defines a callback used to return the details about the device-cloud data change.|
94| [Rdb_SubscribeCallback](#rdb_subscribecallback) | Defines a callback used to return the subscribed event.|
95| [Rdb_DataObserver](#rdb_dataobserver) | Defines a struct for the data observer.|
96| [Rdb_SyncMode](#rdb_syncmode) | Defines an enum for RDB store sync modes.|
97| [Rdb_Statistic](#rdb_statistic) | Defines a struct for the device-cloud sync statistics of a database table.|
98| [Rdb_TableDetails](#rdb_tabledetails) | Defines a struct for statistics of device-cloud upload and download tasks of a database table.|
99| [Rdb_Progress](#rdb_progress) | Defines an enum for device-cloud sync progress states.|
100| [Rdb_ProgressCode](#rdb_progresscode) | Defines an enum for device-cloud sync states.|
101| [Rdb_ProgressDetails](#rdb_progressdetails) | Defines a struct for statistics of the overall device-cloud sync (upload and download) tasks of an RDB store.|
102| [Rdb_ProgressCallback](#rdb_progresscallback) | Defines a callback used to return the device-cloud sync progress.|
103| [Rdb_SyncCallback](#rdb_synccallback) | Defines a callback for device-cloud sync.|
104| [Rdb_ProgressObserver](#rdb_progressobserver) | Defines the observer of the device-cloud sync progress.|
105| [OH_Rdb_ErrCode](#oh_rdb_errcode) | Defines an enum for error codes.|
106
107
108### Enums
109
110| Name| Description|
111| -------- | -------- |
112| [Rdb_DBType](#rdb_dbtype-1) { RDB_SQLITE = 1, RDB_CAYLEY = 2, DBTYPE_BUTT = 64 } | Enumerates the database kernel types.|
113| [OH_OrderType](#oh_ordertype-1) { ASC = 0, DESC = 1 } | Enumerates the sorting types.|
114| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel-1) { S1 = 1, S2, S3, S4 } | Enumerates the RDB store security levels.|
115| [Rdb_SecurityArea](#rdb_securityarea-1) { RDB_SECURITY_AREA_EL1 = 1, RDB_SECURITY_AREA_EL2, RDB_SECURITY_AREA_EL3, RDB_SECURITY_AREA_EL4 } | Enumerates the encryption levels of database files.|
116| [Rdb_DistributedType](#rdb_distributedtype-1) { RDB_DISTRIBUTED_CLOUD } | Enumerates the distributed types.|
117| [Rdb_ChangeType](#rdb_changetype-1) { RDB_DATA_CHANGE, RDB_ASSET_CHANGE } | Enumerates the data change types.|
118| [Rdb_SubscribeType](#rdb_subscribetype-1) { RDB_SUBSCRIBE_TYPE_CLOUD, RDB_SUBSCRIBE_TYPE_CLOUD_DETAILS, RDB_SUBSCRIBE_TYPE_LOCAL_DETAILS } | Enumerates the subscription types.|
119| [Rdb_SyncMode](#rdb_syncmode-1) { RDB_SYNC_MODE_TIME_FIRST, RDB_SYNC_MODE_NATIVE_FIRST, RDB_SYNC_MODE_CLOUD_FIRST } | Enumerates the RDB store sync modes.|
120| [Rdb_Progress](#rdb_progress-1) { RDB_SYNC_BEGIN, RDB_SYNC_IN_PROGRESS, RDB_SYNC_FINISH } | Enumerates the device-cloud sync progresses.|
121| [Rdb_ProgressCode](#rdb_progresscode-1) {<br>RDB_SUCCESS, RDB_UNKNOWN_ERROR, RDB_NETWORK_ERROR, RDB_CLOUD_DISABLED,<br>RDB_LOCKED_BY_OTHERS, RDB_RECORD_LIMIT_EXCEEDED, RDB_NO_SPACE_FOR_ASSET<br>} | Enumerates the device-cloud sync states.|
122| [OH_ColumnType](#oh_columntype-1) {<br>TYPE_NULL = 0, TYPE_INT64, TYPE_REAL, TYPE_TEXT,<br>TYPE_BLOB, TYPE_ASSET, TYPE_ASSETS, TYPE_FLOAT_VECTOR,<br>TYPE_UNLIMITED_INT<br>} | Enumerates the column types.|
123| [OH_RDB_TransType](#oh_rdb_transtype-1) { RDB_TRANS_DEFERRED = 0, RDB_TRANS_IMMEDIATE, RDB_TRANS_EXCLUSIVE, RDB_TRANS_BUTT } | Enumerates the transaction types of an RDB store.|
124| [Rdb_Tokenizer](#rdb_tokenizer-1) { RDB_NONE_TOKENIZER = 1, RDB_ICU_TOKENIZER = 2, RDB_CUSTOM_TOKENIZER = 3 } | Enumerates the database tokenizer types.|
125| [Rdb_ConflictResolution](#rdb_conflictresolution-1) {<br>RDB_CONFLICT_NONE = 1, RDB_CONFLICT_ROLLBACK, RDB_CONFLICT_ABORT, RDB_CONFLICT_FAIL,<br>RDB_CONFLICT_IGNORE, RDB_CONFLICT_REPLACE<br>} | Enumerates the conflict resolution policies.|
126| [OH_Rdb_ErrCode](#oh_rdb_errcode-1) {<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>RDB_E_ALREADY_CLOSED = (E_BASE + 50), RDB_E_DATABASE_BUSY = (E_BASE + 51), RDB_E_SQLITE_CORRUPT = (E_BASE + 52), RDB_E_SQLITE_PERM = (E_BASE + 53),<br>RDB_E_SQLITE_BUSY = (E_BASE + 54), RDB_E_SQLITE_LOCKED = (E_BASE + 55), RDB_E_SQLITE_NOMEM = (E_BASE + 56), RDB_E_SQLITE_READONLY = (E_BASE + 57),<br>RDB_E_SQLITE_IOERR = (E_BASE + 58), RDB_E_SQLITE_FULL = (E_BASE + 59), RDB_E_SQLITE_CANT_OPEN = (E_BASE + 60), RDB_E_SQLITE_TOO_BIG = (E_BASE + 61),<br>RDB_E_SQLITE_MISMATCH = (E_BASE + 62), RDB_E_DATA_TYPE_NULL = (E_BASE + 63), RDB_E_TYPE_MISMATCH = (E_BASE + 64), RDB_E_SQLITE_CONSTRAINT = (E_BASE + 65)<br>} | Enumerates the RDB store error codes.|
127
128
129### Functions
130
131| Name| Description|
132| -------- | -------- |
133| int [OH_RdbTrans_BatchInsert](#oh_rdbtrans_batchinsert) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const char \*table, const [OH_Data_VBuckets](#oh_data_vbuckets) \*rows, [Rdb_ConflictResolution](#rdb_conflictresolution) resolution, int64_t \*changes) | Inserts a batch of data into a table.|
134| int [OH_Rdb_BatchInsert](#oh_rdb_batchinsert) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*table, const [OH_Data_VBuckets](#oh_data_vbuckets) \*rows, [Rdb_ConflictResolution](#rdb_conflictresolution) resolution, int64_t \*changes) | Inserts a batch of data into a table.|
135| int [OH_Rdb_SetPersistent](#oh_rdb_setpersistent) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, bool isPersistent) | Sets whether to persist an RDB store.|
136| int [OH_Rdb_IsTokenizerSupported](#oh_rdb_istokenizersupported) ([Rdb_Tokenizer](#rdb_tokenizer) tokenizer, bool \*isSupported) | Checks whether the specified tokenizer is supported.|
137| int [OH_Rdb_SetTokenizer](#oh_rdb_settokenizer) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, [Rdb_Tokenizer](#rdb_tokenizer) tokenizer) | Sets the tokenizer type.|
138| int [OH_Cursor_GetFloatVectorCount](#oh_cursor_getfloatvectorcount) ([OH_Cursor](_o_h___cursor.md) \*cursor, int32_t columnIndex, size_t \*length) | Obtains the length of the float array in the specified column of the current row.|
139| int [OH_Cursor_GetFloatVector](#oh_cursor_getfloatvector) ([OH_Cursor](_o_h___cursor.md) \*cursor, int32_t columnIndex, float \*val, size_t inLen, size_t \*outLen) | Obtains the value in a specified column of the current row in the form of a float array.|
140| int [OH_Rdb_ExecuteV2](#oh_rdb_executev2) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql, const [OH_Data_Values](#oh_data_values) \*args, [OH_Data_Value](#oh_data_value) \*\*result) | Executes an SQL statement with a return value. This API supports vector stores.|
141| [OH_Cursor](_o_h___cursor.md) \* [OH_Rdb_ExecuteQueryV2](#oh_rdb_executequeryv2) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql, const [OH_Data_Values](#oh_data_values) \*args) | Queries data in the database using the specified SQL statement. This API supports vector stores.|
142| [OH_Data_Value](#oh_data_value) \* [OH_Value_Create](#oh_value_create) (void) | Creates an [OH_Data_Value](#oh_data_value) instance to store a single KV pair.|
143| int [OH_Value_Destroy](#oh_value_destroy) ([OH_Data_Value](#oh_data_value) \*value) | Destroys an [OH_Data_Value](#oh_data_value) instance.|
144| int [OH_Value_PutNull](#oh_value_putnull) ([OH_Data_Value](#oh_data_value) \*value) | Adds empty data to an **OH_Data_Value** instance.|
145| int [OH_Value_PutInt](#oh_value_putint) ([OH_Data_Value](#oh_data_value) \*value, int64_t val) | Adds an integer to an **OH_Data_Value** instance.|
146| int [OH_Value_PutReal](#oh_value_putreal) ([OH_Data_Value](#oh_data_value) \*value, double val) | Adds REAL data to an **OH_Data_Value** instance.|
147| int [OH_Value_PutText](#oh_value_puttext) ([OH_Data_Value](#oh_data_value) \*value, const char \*val) | Adds a string to an **OH_Data_Value** instance.|
148| int [OH_Value_PutBlob](#oh_value_putblob) ([OH_Data_Value](#oh_data_value) \*value, const unsigned char \*val, size_t length) | Adds BLOB data to an **OH_Data_Value** instance.|
149| int [OH_Value_PutAsset](#oh_value_putasset) ([OH_Data_Value](#oh_data_value) \*value, const Data_Asset \*val) | Adds an asset to an **OH_Data_Value** instance.|
150| int [OH_Value_PutAssets](#oh_value_putassets) ([OH_Data_Value](#oh_data_value) \*value, const Data_Asset \*const \*val, size_t length) | Adds assets to an **OH_Data_Value** instance.|
151| int [OH_Value_PutFloatVector](#oh_value_putfloatvector) ([OH_Data_Value](#oh_data_value) \*value, const float \*val, size_t length) | Adds a float array to an **OH_Data_Value** instance.|
152| int [OH_Value_PutUnlimitedInt](#oh_value_putunlimitedint) ([OH_Data_Value](#oh_data_value) \*value, int sign, const uint64_t \*trueForm, size_t length) | Adds an integer array of any length to an **OH_Data_Value** instance.|
153| int [OH_Value_GetType](#oh_value_gettype) ([OH_Data_Value](#oh_data_value) \*value, [OH_ColumnType](#oh_columntype) \*type) | Obtains the data type.|
154| int [OH_Value_IsNull](#oh_value_isnull) ([OH_Data_Value](#oh_data_value) \*value, bool \*val) | Checks whether a value is null.|
155| int [OH_Value_GetInt](#oh_value_getint) ([OH_Data_Value](#oh_data_value) \*value, int64_t \*val) | Obtains the integer from an **OH_Data_Value** instance.|
156| int [OH_Value_GetReal](#oh_value_getreal) ([OH_Data_Value](#oh_data_value) \*value, double \*val) | Obtains the REAL data from an **OH_Data_Value** instance.|
157| int [OH_Value_GetText](#oh_value_gettext) ([OH_Data_Value](#oh_data_value) \*value, const char \*\*val) | Obtains the string from an **OH_Data_Value** instance.|
158| int [OH_Value_GetBlob](#oh_value_getblob) ([OH_Data_Value](#oh_data_value) \*value, const uint8_t \*\*val, size_t \*length) | Obtains the BLOB data from an **OH_Data_Value** instance.|
159| int [OH_Value_GetAsset](#oh_value_getasset) ([OH_Data_Value](#oh_data_value) \*value, Data_Asset \*val) | Obtains the asset from an **OH_Data_Value** instance.|
160| int [OH_Value_GetAssetsCount](#oh_value_getassetscount) ([OH_Data_Value](#oh_data_value) \*value, size_t \*length) | Obtains the length of the asset in an **OH_Data_Value** instance.|
161| int [OH_Value_GetAssets](#oh_value_getassets) ([OH_Data_Value](#oh_data_value) \*value, Data_Asset \*\*val, size_t inLen, size_t \*outLen) | Obtains the assets from an **OH_Data_Value** instance.|
162| int [OH_Value_GetFloatVectorCount](#oh_value_getfloatvectorcount) ([OH_Data_Value](#oh_data_value) \*value, size_t \*length) | Obtains the length of the float array in an **OH_Data_Value** instance.|
163| int [OH_Value_GetFloatVector](#oh_value_getfloatvector) ([OH_Data_Value](#oh_data_value) \*value, float \*val, size_t inLen, size_t \*outLen) | Obtains the float array from an **OH_Data_Value** instance.|
164| int [OH_Value_GetUnlimitedIntBand](#oh_value_getunlimitedintband) ([OH_Data_Value](#oh_data_value) \*value, size_t \*length) | Obtains the length of the unlimited integer from an **OH_Data_Value** instance.|
165| int [OH_Value_GetUnlimitedInt](#oh_value_getunlimitedint) ([OH_Data_Value](#oh_data_value) \*value, int \*sign, uint64_t \*trueForm, size_t inLen, size_t \*outLen) | Obtains the unlimited integer from an **OH_Data_Value** instance.|
166| [OH_Data_Values](#oh_data_values) \* [OH_Values_Create](#oh_values_create) (void) | Creates an [OH_Data_Values](#oh_data_values) instance to store multiple KV pairs.|
167| int [OH_Values_Destroy](#oh_values_destroy) ([OH_Data_Values](#oh_data_values) \*values) | Destroys an [OH_Data_Values](#oh_data_values) instance.|
168| int [OH_Values_Put](#oh_values_put) ([OH_Data_Values](#oh_data_values) \*values, const [OH_Data_Value](#oh_data_value) \*val) | Adds data of the **OH_Data_Value** type to an **OH_Data_Values** instance.|
169| int [OH_Values_PutNull](#oh_values_putnull) ([OH_Data_Values](#oh_data_values) \*values) | Adds empty data to an **OH_Data_Values** instance.|
170| int [OH_Values_PutInt](#oh_values_putint) ([OH_Data_Values](#oh_data_values) \*values, int64_t val) | Adds an integer to an **OH_Data_Values** instance.|
171| int [OH_Values_PutReal](#oh_values_putreal) ([OH_Data_Values](#oh_data_values) \*values, double val) | Adds REAL data to an **OH_Data_Values** instance.|
172| int [OH_Values_PutText](#oh_values_puttext) ([OH_Data_Values](#oh_data_values) \*values, const char \*val) | Adds a string to an **OH_Data_Values** instance.|
173| int [OH_Values_PutBlob](#oh_values_putblob) ([OH_Data_Values](#oh_data_values) \*values, const unsigned char \*val, size_t length) | Adds BLOB data to an **OH_Data_Values** instance.|
174| int [OH_Values_PutAsset](#oh_values_putasset) ([OH_Data_Values](#oh_data_values) \*values, const Data_Asset \*val) | Adds an asset to an **OH_Data_Values** instance.|
175| int [OH_Values_PutAssets](#oh_values_putassets) ([OH_Data_Values](#oh_data_values) \*values, const Data_Asset \*const \*val, size_t length) | Adds assets to an **OH_Data_Values** instance.|
176| int [OH_Values_PutFloatVector](#oh_values_putfloatvector) ([OH_Data_Values](#oh_data_values) \*values, const float \*val, size_t length) | Adds a float array to an **OH_Data_Values** instance.|
177| int [OH_Values_PutUnlimitedInt](#oh_values_putunlimitedint) ([OH_Data_Values](#oh_data_values) \*values, int sign, const uint64_t \*trueForm, size_t length) | Adds an integer array of any length to an **OH_Data_Values** instance.|
178| int [OH_Values_Count](#oh_values_count) ([OH_Data_Values](#oh_data_values) \*values, size_t \*count) | Obtains the number of values in an **OH_Data_Values** instance.|
179| int [OH_Values_GetType](#oh_values_gettype) ([OH_Data_Values](#oh_data_values) \*values, int index, [OH_ColumnType](#oh_columntype) \*type) | Obtains the type of a value in an **OH_Data_Values** instance.|
180| int [OH_Values_Get](#oh_values_get) ([OH_Data_Values](#oh_data_values) \*values, int index, [OH_Data_Value](#oh_data_value) \*\*val) | Obtains data of the **OH_Data_Value** type.|
181| int [OH_Values_IsNull](#oh_values_isnull) ([OH_Data_Values](#oh_data_values) \*values, int index, bool \*val) | Checks whether a value is null.|
182| int [OH_Values_GetInt](#oh_values_getint) ([OH_Data_Values](#oh_data_values) \*values, int index, int64_t \*val) | Obtains the integer from an **OH_Data_Values** instance.|
183| int [OH_Values_GetReal](#oh_values_getreal) ([OH_Data_Values](#oh_data_values) \*values, int index, double \*val) | Obtains the REAL data from an **OH_Data_Values** instance.|
184| int [OH_Values_GetText](#oh_values_gettext) ([OH_Data_Values](#oh_data_values) \*values, int index, const char \*\*val) | Obtains the string from an **OH_Data_Values** instance.|
185| int [OH_Values_GetBlob](#oh_values_getblob) ([OH_Data_Values](#oh_data_values) \*values, int index, const uint8_t \*\*val, size_t \*length) | Obtains the BLOB data from an **OH_Data_Values** instance.|
186| int [OH_Values_GetAsset](#oh_values_getasset) ([OH_Data_Values](#oh_data_values) \*values, int index, Data_Asset \*val) | Obtains the asset from an **OH_Data_Values** instance.|
187| int [OH_Values_GetAssetsCount](#oh_values_getassetscount) ([OH_Data_Values](#oh_data_values) \*values, int index, size_t \*length) | Obtains the length of the asset in an **OH_Data_Values** instance.|
188| int [OH_Values_GetAssets](#oh_values_getassets) ([OH_Data_Values](#oh_data_values) \*values, int index, Data_Asset \*\*val, size_t inLen, size_t \*outLen) | Obtains the assets from an **OH_Data_Values** instance.|
189| int [OH_Values_GetFloatVectorCount](#oh_values_getfloatvectorcount) ([OH_Data_Values](#oh_data_values) \*values, int index, size_t \*length) | Obtains the length of the float array in an **OH_Data_Values** instance.|
190| int [OH_Values_GetFloatVector](#oh_values_getfloatvector) ([OH_Data_Values](#oh_data_values) \*values, int index, float \*val, size_t inLen, size_t \*outLen) | Obtains the float array from an **OH_Data_Values** instance.|
191| int [OH_Values_GetUnlimitedIntBand](#oh_values_getunlimitedintband) ([OH_Data_Values](#oh_data_values) \*values, int index, size_t \*length) | Obtains the length of the unlimited integer from an **OH_Data_Values** instance.|
192| int [OH_Values_GetUnlimitedInt](#oh_values_getunlimitedint) ([OH_Data_Values](#oh_data_values) \*values, int index, int \*sign, uint64_t \*trueForm, size_t inLen, size_t \*outLen) | Obtains the unlimited integer from an **OH_Data_Values** instance.|
193| [OH_Data_VBuckets](#oh_data_vbuckets) \* [OH_VBuckets_Create](#oh_vbuckets_create) (void) | Creates an **OH_Data_VBuckets** instance.|
194| int [OH_VBuckets_Destroy](#oh_vbuckets_destroy) ([OH_Data_VBuckets](#oh_data_vbuckets) \*buckets) | Destroys an **OH_Data_VBuckets** instance.|
195| int [OH_VBuckets_PutRow](#oh_vbuckets_putrow) ([OH_Data_VBuckets](#oh_data_vbuckets) \*buckets, const [OH_VBucket](_o_h___v_bucket.md) \*row) | Adds data of the **OH_VBucket** type to an **OH_Data_VBuckets** instance.|
196| int [OH_VBuckets_PutRows](#oh_vbuckets_putrows) ([OH_Data_VBuckets](#oh_data_vbuckets) \*buckets, const [OH_Data_VBuckets](#oh_data_vbuckets) \*rows) | Adds data of the **OH_Data_VBuckets** type to an **OH_Data_VBuckets** instance.|
197| int [OH_VBuckets_RowCount](#oh_vbuckets_rowcount) ([OH_Data_VBuckets](#oh_data_vbuckets) \*buckets, size_t \*count) | Obtains the number **OH_VBucket**s in an **OH_Data_VBuckets** instance.|
198| [OH_RDB_TransOptions](#oh_rdb_transoptions) \* [OH_RdbTrans_CreateOptions](#oh_rdbtrans_createoptions) (void) | Creates a **TransOptions** instance.|
199| int [OH_RdbTrans_DestroyOptions](#oh_rdbtrans_destroyoptions) ([OH_RDB_TransOptions](#oh_rdb_transoptions) \*opitons) | Destroys a **TransOptions** instance.|
200| int [OH_RdbTransOption_SetType](#oh_rdbtransoption_settype) ([OH_RDB_TransOptions](#oh_rdb_transoptions) \*opitons, [OH_RDB_TransType](#oh_rdb_transtype) type) | Sets the transaction type of an RDB store.|
201| int [OH_RdbTrans_Commit](#oh_rdbtrans_commit) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans) | Commits a transaction.|
202| int [OH_RdbTrans_Rollback](#oh_rdbtrans_rollback) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans) | Rolls back a transaction.|
203| int [OH_RdbTrans_Insert](#oh_rdbtrans_insert) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const char \*table, const [OH_VBucket](_o_h___v_bucket.md) \*row, int64_t \*rowId) | Inserts a row of data into a table.|
204| int [OH_RdbTrans_Update](#oh_rdbtrans_update) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const [OH_VBucket](_o_h___v_bucket.md) \*row, const [OH_Predicates](_o_h___predicates.md) \*predicates, int64_t \*changes) | Updates data in an RDB store based on specified conditions.|
205| int [OH_RdbTrans_Delete](#oh_rdbtrans_delete) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const [OH_Predicates](_o_h___predicates.md) \*predicates, int64_t \*changes) | Deletes data from the database based on the specified conditions.|
206| [OH_Cursor](_o_h___cursor.md) \* [OH_RdbTrans_Query](#oh_rdbtrans_query) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const [OH_Predicates](_o_h___predicates.md) \*predicates, const char \*columns[], int len) | Queries data in the database based on specified conditions.|
207| [OH_Cursor](_o_h___cursor.md) \* [OH_RdbTrans_QuerySql](#oh_rdbtrans_querysql) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const char \*sql, const [OH_Data_Values](#oh_data_values) \*args) | Queries data in the database using the specified SQL statement.|
208| int [OH_RdbTrans_Execute](#oh_rdbtrans_execute) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans, const char \*sql, const [OH_Data_Values](#oh_data_values) \*args, [OH_Data_Value](#oh_data_value) \*\*result) | Executes an SQL statement that contains specified parameters.|
209| int [OH_RdbTrans_Destroy](#oh_rdbtrans_destroy) ([OH_Rdb_Transaction](#oh_rdb_transaction) \*trans) | Destroys a transaction object.|
210| int [OH_VBucket_PutFloatVector](#oh_vbucket_putfloatvector) ([OH_VBucket](_o_h___v_bucket.md) \*bucket, const char \*field, const float \*vec, size_t len) | Puts a float array into an [OH_VBucket](_o_h___v_bucket.md) instance in the given column.|
211| int [OH_VBucket_PutUnlimitedInt](#oh_vbucket_putunlimitedint) ([OH_VBucket](_o_h___v_bucket.md) \*bucket, const char \*field, int sign, const uint64_t \*trueForm, size_t len) | Puts an integer of any length into an [OH_VBucket](_o_h___v_bucket.md) instance in the given column.|
212| [OH_Rdb_ConfigV2](#oh_rdb_configv2) \* [OH_Rdb_CreateConfig](#oh_rdb_createconfig) () | Creates an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
213| int [OH_Rdb_DestroyConfig](#oh_rdb_destroyconfig) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config) | Destroys an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
214| int [OH_Rdb_SetDatabaseDir](#oh_rdb_setdatabasedir) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, const char \*databaseDir) | Sets the database file path for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
215| int [OH_Rdb_SetStoreName](#oh_rdb_setstorename) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, const char \*storeName) | Sets the RDB store name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
216| int [OH_Rdb_SetBundleName](#oh_rdb_setbundlename) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, const char \*bundleName) | Sets the application bundle name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
217| int [OH_Rdb_SetModuleName](#oh_rdb_setmodulename) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, const char \*moduleName) | Sets the module name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
218| int [OH_Rdb_SetEncrypted](#oh_rdb_setencrypted) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, bool isEncrypted) | Sets whether to encrypt the database for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
219| int [OH_Rdb_SetSecurityLevel](#oh_rdb_setsecuritylevel) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, int securityLevel) | Sets the [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
220| int [OH_Rdb_SetArea](#oh_rdb_setarea) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, int area) | Sets the [Rdb_SecurityArea](#rdb_securityarea) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
221| int [OH_Rdb_SetDbType](#oh_rdb_setdbtype) ([OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, int dbType) | Sets the [Rdb_DBType](#rdb_dbtype) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.|
222| const int \* [OH_Rdb_GetSupportedDbType](#oh_rdb_getsupporteddbtype) (int \*typeCount) | Obtains the supported database types ([Rdb_DBType](#rdb_dbtype)).|
223| [OH_Rdb_Store](_o_h___rdb___store.md) \* [OH_Rdb_CreateOrOpen](#oh_rdb_createoropen) (const [OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config, int \*errCode) | Creates or opens an [OH_Rdb_Store](_o_h___rdb___store.md) instance based on the given [OH_Rdb_ConfigV2](#oh_rdb_configv2).|
224| int [OH_Rdb_DeleteStoreV2](#oh_rdb_deletestorev2) (const [OH_Rdb_ConfigV2](#oh_rdb_configv2) \*config) | Deletes an RDB store based on the given [OH_Rdb_ConfigV2](#oh_rdb_configv2). For a vector store, ensure that the vector store is correctly closed before calling this API.|
225| int [OH_Rdb_ExecuteByTrxId](#oh_rdb_executebytrxid) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int64_t trxId, const char \*sql) | Executes an SQL statement that returns no value based on the specified transaction ID. This API supports only vector stores.|
226| int [OH_Rdb_BeginTransWithTrxId](#oh_rdb_begintranswithtrxid) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int64_t \*trxId) | Begins a transaction. This API returns a transaction ID. This API supports only vector stores.|
227| int [OH_Rdb_RollBackByTrxId](#oh_rdb_rollbackbytrxid) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int64_t trxId) | Rolls back the executed SQL statements based on the specified transaction ID. This API supports only vector stores.|
228| int [OH_Rdb_CommitByTrxId](#oh_rdb_commitbytrxid) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int64_t trxId) | Commits the executed SQL statements based on the specified transaction ID. This API supports only vector stores.|
229| [OH_VBucket_PutAsset](#oh_vbucket_putasset) ([OH_VBucket](_o_h___v_bucket.md) \*bucket, const char \*field, OH_Asset \*value) | Puts an **OH_Asset** object into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
230| [OH_VBucket_PutAssets](#oh_vbucket_putassets) ([OH_VBucket](_o_h___v_bucket.md) \*bucket, const char \*field, OH_Asset \*\*value, int count) | Puts an array of **OH_Asset** objects into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
231| [OH_Rdb_CreateValueObject](#oh_rdb_createvalueobject) () | Creates an [OH_VObject](_o_h___v_object.md) instance.|
232| [OH_Rdb_CreateValuesBucket](#oh_rdb_createvaluesbucket) () | Creates an [OH_VBucket](_o_h___v_bucket.md) instance.|
233| [OH_Rdb_CreatePredicates](#oh_rdb_createpredicates) (const char \*table) | Creates an [OH_Predicates](_o_h___predicates.md) instance.|
234| [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.|
235| [OH_Rdb_CloseStore](#oh_rdb_closestore) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Closes an [OH_Rdb_Store](_o_h___rdb___store.md) object to reclaim the memory occupied.|
236| [OH_Rdb_DeleteStore](#oh_rdb_deletestore) (const [OH_Rdb_Config](_o_h___rdb___config.md) \*config) | Deletes an RDB store with the specified configuration.|
237| [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.|
238| [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.|
239| [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.|
240| [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.|
241| [OH_Rdb_Execute](#oh_rdb_execute) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Executes an SQL statement that returns no value.|
242| [OH_Rdb_ExecuteQuery](#oh_rdb_executequery) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Queries data in the database using the specified SQL statement. This API supports vector stores.|
243| [OH_Rdb_BeginTransaction](#oh_rdb_begintransaction) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Begins the transaction before executing SQL statements.|
244| [OH_Rdb_RollBack](#oh_rdb_rollback) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Rolls back the SQL statements executed.|
245| [OH_Rdb_Commit](#oh_rdb_commit) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Commits the executed SQL statements.|
246| [OH_Rdb_Backup](#oh_rdb_backup) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Backs up an RDB store using the backup file of the specified path. This API supports vector stores.|
247| [OH_Rdb_Restore](#oh_rdb_restore) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Restores a database from a specified database backup file. This API supports vector stores.|
248| [OH_Rdb_GetVersion](#oh_rdb_getversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int \*version) | Obtains the RDB store version.|
249| [OH_Rdb_SetVersion](#oh_rdb_setversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int version) | Sets the RDB store version.|
250| [OH_Rdb_SetDistributedTables](#oh_rdb_setdistributedtables) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*tables[], uint32_t count, [Rdb_DistributedType](#rdb_distributedtype) type, const [Rdb_DistributedConfig](_rdb___distributed_config.md) \*config) | Sets distributed database tables.|
251| [OH_Rdb_FindModifyTime](#oh_rdb_findmodifytime) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*tableName, const char \*columnName, [OH_VObject](_o_h___v_object.md) \*values) | Obtains the last modification time of a table in an RDB store.|
252| [OH_Rdb_Subscribe](#oh_rdb_subscribe) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [Rdb_SubscribeType](#rdb_subscribetype) type, const [Rdb_DataObserver](_rdb___data_observer.md) \*observer) | Registers an observer for an RDB store. When data in the RDB store changes, a callback will be invoked to return the data changes.|
253| [OH_Rdb_Unsubscribe](#oh_rdb_unsubscribe) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [Rdb_SubscribeType](#rdb_subscribetype) type, const [Rdb_DataObserver](_rdb___data_observer.md) \*observer) | Unregisters the observer of the specified type.|
254| [OH_Rdb_GetTableDetails](#oh_rdb_gettabledetails) ([Rdb_ProgressDetails](_rdb___progress_details.md) \*progress, int32_t version) | Obtains the device-cloud sync statistics of a table.|
255| [OH_Rdb_CloudSync](#oh_rdb_cloudsync) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [Rdb_SyncMode](#rdb_syncmode) mode, const char \*tables, int count, const [Rdb_ProgressObserver](_rdb___progress_observer.md) \*observer) | Performs device-cloud sync.|
256| [OH_Rdb_SubscribeAutoSyncProgress](#oh_rdb_subscribeautosyncprogress) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const [Rdb_ProgressObserver](_rdb___progress_observer.md) \*observer) | Subscribes to the auto sync progress of an RDB store. The registered callback will be invoked to return the auto sync progress.|
257| [OH_Rdb_UnsubscribeAutoSyncProgress](#oh_rdb_unsubscribeautosyncprogress) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const [Rdb_ProgressObserver](_rdb___progress_observer.md) \*observer) | Unsubscribes from the auto sync process of an RDB store.|
258| int [OH_Rdb_LockRow](#oh_rdb_lockrow) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_Predicates](_o_h___predicates.md) \*predicates) | Locks data in an RDB store based on specified conditions. The locked data will be blocked from the device-cloud sync.|
259| int [OH_Rdb_UnlockRow](#oh_rdb_unlockrow) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_Predicates](_o_h___predicates.md) \*predicates) | Unlocks data in an RDB store based on the specified conditions.|
260| [OH_Cursor](_o_h___cursor.md) \* [OH_Rdb_QueryLockedRow](#oh_rdb_querylockedrow) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, [OH_Predicates](_o_h___predicates.md) \*predicates, const char \*const \*columnNames, int length) | Queries the locked data in an RDB store.|
261
262### Variables
263
264| Name| Description|
265| -------- | -------- |
266| [OH_Cursor::id](#id-15) | Unique identifier of the **OH_Cursor** struct.|
267| [OH_Cursor::getColumnCount](#getcolumncount) | Pointer to the function used to obtain the number of columns in the result set.|
268| [OH_Cursor::getColumnType](#getcolumntype) | Pointer to the function used to obtain the column type based on the specified column index.|
269| [OH_Cursor::getColumnIndex](#getcolumnindex) | Pointer to the function used to obtain the column index based on the specified column name.|
270| [OH_Cursor::getColumnName](#getcolumnname) | Pointer to the function used to obtain the column name based on the specified column index.|
271| [OH_Cursor::getRowCount](#getrowcount) | Pointer to the function used to obtain the number of rows in the result set.|
272| [OH_Cursor::goToNextRow](#gotonextrow) | Pointer to the function used to go to the next row of the result set.|
273| [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**.|
274| [OH_Cursor::getText](#gettext) | Pointer to the function used to obtain the value of the string type based on the specified column and the current row.|
275| [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.|
276| [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.|
277| [OH_Cursor::getBlob](#getblob) | Pointer to the function used to obtain the values in the form of a byte array based on the specified column and the current row.|
278| [OH_Cursor::isNull](#isnull-12) | Pointer to the function used to check whether the value in the specified column is null.|
279| [OH_Cursor::destroy](#destroy-14) | Pointer to the function used to destroy a result set.|
280| [OH_Cursor::getAsset](#getasset) | Pointer to the function used to obtain the value of the asset type based on the specified column and the current row.|
281| [OH_Cursor::getAssets](#getassets) | Pointer to the function used to obtain the values in the form of an asset array based on the specified column and the current row.|
282| [OH_Predicates::id](#id-25) | Unique identifier of the **OH_Predicates** struct.|
283| [OH_Predicates::equalTo](#equalto) | Pointer to the function used to create a predicates object to search for the field values that are equal to the specified value.|
284| [OH_Predicates::notEqualTo](#notequalto) | Pointer to the function used to create a predicates object to search for the field values that are not equal to the specified value.|
285| [OH_Predicates::beginWrap](#beginwrap) | Pointer to the function used to add a left parenthesis to the predicates.|
286| [OH_Predicates::endWrap](#endwrap) | Pointer to the function used to add a right parenthesis to the predicates.|
287| [OH_Predicates::orOperate](#oroperate) | Pointer to the function used to add the OR operator to the predicates.|
288| [OH_Predicates::andOperate](#andoperate) | Pointer to the function used to add the AND operator to the predicates.|
289| [OH_Predicates::isNull](#isnull-22) | Pointer to the function used to create a predicates object to search for the field values that are null.|
290| [OH_Predicates::isNotNull](#isnotnull) | Pointer to the function used to create a predicates object to search for the field values that are not null.|
291| [OH_Predicates::like](#like) | Pointer to the function used to create a predicates object to search for the field values that are similar to the specified string.|
292| [OH_Predicates::between](#between) | Pointer to the function used to create a predicates object to search for the field values that are within the specified range.|
293| [OH_Predicates::notBetween](#notbetween) | Pointer to the function used to create a predicates object to search for the field values that are out of the specified range.|
294| [OH_Predicates::greaterThan](#greaterthan) | Pointer to the function used to create a predicates object to search for the field values that are greater than the specified value.|
295| [OH_Predicates::lessThan](#lessthan) | Pointer to the function used to create a predicates object to search for the field values that are less than the specified value.|
296| [OH_Predicates::greaterThanOrEqualTo](#greaterthanorequalto) | Pointer to the function used to create a predicates object to search for the field values that are greater than or equal to the specified value.|
297| [OH_Predicates::lessThanOrEqualTo](#lessthanorequalto) | Pointer to the function used to create a predicates object to search for the field values that are less than or equal to the specified value.|
298| [OH_Predicates::orderBy](#orderby) | Pointer to the function used to create a predicates object to sort the values in the specified column in ascending or descending order.|
299| [OH_Predicates::distinct](#distinct) | Pointer to the function used to create a predicates object to filter out duplicate records.|
300| [OH_Predicates::limit](#limit) | Pointer to the function used to create a predicates object to specify the maximum number of records.|
301| [OH_Predicates::offset](#offset) | Pointer to the function used to create a predicates object to specify the start position of the query result.|
302| [OH_Predicates::groupBy](#groupby) | Pointer to the function used to create a predicates object to group the results by the specified columns.|
303| [OH_Predicates::in](#in) | Pointer to the function used to create a predicates object to search for the field values that are within the specified range.|
304| [OH_Predicates::notIn](#notin) | Pointer to the function used to create a predicates object to search for the field values that are out of the specified range.|
305| [OH_Predicates::clear](#clear-12) | Pointer to the function used to clear a predicates instance.|
306| [OH_Predicates::destroy](#destroy-24) | Pointer to the function used to destroy an [OH_Predicates](_o_h___predicates.md) object to reclaim the memory occupied.|
307| [OH_VObject::id](#id-35) | Unique identifier of the **OH_VObject** struct.|
308| [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.|
309| [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.|
310| [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.|
311| [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.|
312| [OH_VObject::destroy](#destroy-44) | Pointer to the function used to destroy an [OH_VObject](_o_h___v_object.md) object to reclaim the memory occupied.|
313| [OH_VBucket::id](#id-45) | Unique identifier of the **OH_VBucket** struct.|
314| [OH_VBucket::capability](#capability) | Number of the KV pairs in an **OH_VBucket** instance.|
315| [OH_VBucket::putText](#puttext-12) | Pointer to the function used to put a char value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
316| [OH_VBucket::putInt64](#putint64-12) | Pointer to the function used to put an int64_t value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
317| [OH_VBucket::putReal](#putreal) | Pointer to the function used to put a double value into the **OH_VBucket** object in the given column.|
318| [OH_VBucket::putBlob](#putblob) | Pointer to the function used to put a const uint8_t value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
319| [OH_VBucket::putNull](#putnull) | Pointer to the function used to put a null value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
320| [OH_VBucket::clear](#clear-22) | Pointer to the function used to clear an [OH_VBucket](_o_h___v_bucket.md) object.|
321| [OH_VBucket::destroy](#destroy-34) | Pointer to the function used to destroy an [OH_VBucket](_o_h___v_bucket.md) object to reclaim the memory occupied.|
322| [OH_Rdb_Config::selfSize](#selfsize) | Size of the struct.|
323| [OH_Rdb_Config::dataBaseDir](#databasedir) | Path of the database file.|
324| [OH_Rdb_Config::storeName](#storename) | Name of the RDB store.|
325| [OH_Rdb_Config::bundleName](#bundlename) | Bundle name.|
326| [OH_Rdb_Config::moduleName](#modulename) | Module name. |
327| [OH_Rdb_Config::isEncrypt](#isencrypt) | Whether to encrypt the RDB store.|
328| [OH_Rdb_Config::securityLevel](#securitylevel) | RDB store security level. For details, see [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel).|
329| [OH_Rdb_Config::area](#area) | Database file encryption level. For details, see [Rdb_SecurityArea](#rdb_securityarea).|
330| [OH_Rdb_Store::id](#id-55) | Unique identifier of the **OH_Rdb_Store** struct.|
331| [Rdb_DistributedConfig::version](#version-13) | Version of the **Rdb_DistributedConfig** struct.|
332| [Rdb_DistributedConfig::isAutoSync](#isautosync) | Whether the table supports auto sync.|
333| [Rdb_KeyInfo::count](#count) | Number of the changed primary keys or row numbers.|
334| [Rdb_KeyInfo::type](#type) | [OH_ColumnType](#oh_columntype) of the primary key.|
335| [Rdb_KeyInfo::Rdb_KeyData::integer](#integer) | Data of the uint64_t type.|
336| [Rdb_KeyInfo::Rdb_KeyData::real](#real) | Data of the double type.|
337| [Rdb_KeyInfo::Rdb_KeyData::text](#text) | Data of the char \* type.|
338| [Rdb_KeyInfo::data](_rdb___key_info.md#member-variables)| Changed data.|
339| [Rdb_ChangeInfo::version](#version-23) | Version of the **Rdb_DistributedConfig** struct.|
340| [Rdb_ChangeInfo::tableName](#tablename) | Name of the table with data changes.|
341| [Rdb_ChangeInfo::ChangeType](#changetype) | Type of the data changed, which can be data or asset.|
342| [Rdb_ChangeInfo::inserted](#inserted) | Location where data is inserted. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, it is the row number of the inserted data.|
343| [Rdb_ChangeInfo::updated](#updated) | Location where data is updated. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, it is the row number of the updated data.|
344| [Rdb_ChangeInfo::deleted](#deleted) | Location where data is deleted. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, it is the row number of the deleted data.|
345| [Rdb_SubscribeCallback::detailsObserver](#detailsobserver) | Callback used to return the details about the device-cloud data change.|
346| [Rdb_SubscribeCallback::briefObserver](#briefobserver) | Callback used to return the device-cloud data change event.|
347| [Rdb_DataObserver::context](#context-12) | Context of the data observer.|
348| [Rdb_DataObserver::callback](#callback-12) | Callback used to return the result.|
349| [Rdb_Statistic::total](#total) | Total number of rows to be synced between the device and cloud in the database table.|
350| [Rdb_Statistic::successful](#successful) | Number of rows that are successfully synced between the device and cloud in the database table.|
351| [Rdb_Statistic::failed](#failed) | Number of rows that failed to be synced between the device and cloud in the database table.|
352| [Rdb_Statistic::remained](#remained) | Number of rows that are not executed for device-cloud sync in the database table.|
353| [Rdb_TableDetails::table](#table) | Database table name.|
354| [Rdb_TableDetails::upload](#upload) | Statistics of the device-cloud upload tasks.|
355| [Rdb_TableDetails::download](#download) | Statistics of the device-cloud download tasks.|
356| [Rdb_ProgressDetails::version](#version-33) | Version of the **OH_TableDetails** struct.|
357| [Rdb_ProgressDetails::schedule](#schedule) | Device-cloud sync process.|
358| [Rdb_ProgressDetails::code](#code) | Device-cloud sync state.|
359| [Rdb_ProgressDetails::tableLength](#tablelength) | Number of the tables synced between the device and cloud.|
360| [Rdb_ProgressObserver::context](#context-22) | Context of the device-cloud sync progress observer.|
361| [Rdb_ProgressObserver::callback](#callback-22) | Callback used to return the device-cloud sync progress.|
362
363
364## Macro Description
365
366
367### DISTRIBUTED_CHANGE_INFO_VERSION
368
369```
370#define DISTRIBUTED_CHANGE_INFO_VERSION   1
371```
372
373**Description**
374
375Indicates the version of [Rdb_ChangeInfo](_rdb___change_info.md).
376
377**Since**: 11
378
379
380### DISTRIBUTED_CONFIG_VERSION
381
382```
383#define DISTRIBUTED_CONFIG_VERSION   1
384```
385
386**Description**
387
388Indicates the version of [Rdb_DistributedConfig](_rdb___distributed_config.md).
389
390**Since**: 11
391
392
393### DISTRIBUTED_PROGRESS_DETAIL_VERSION
394
395```
396#define DISTRIBUTED_PROGRESS_DETAIL_VERSION   1
397```
398
399**Description**
400
401Indicates the version of **OH_ProgressDetails**.
402
403**Since**: 11
404
405
406## Type Description
407
408### Rdb_ConflictResolution
409
410```
411typedef enum Rdb_ConflictResolution Rdb_ConflictResolution
412```
413
414**Description**
415
416Defines an enum for conflict resolution policies.
417
418**Since**: 18
419
420### OH_ColumnType
421
422```
423typedef enum OH_ColumnType OH_ColumnType
424```
425
426**Description**
427
428Defines an enum for column types.
429
430**Since**: 10
431
432### OH_Data_Value
433
434```
435typedef struct OH_Data_Value OH_Data_Value
436```
437
438**Description**
439
440Defines the [OH_Data_Value](#oh_data_value) struct.
441
442**Since**: 18
443
444
445### OH_Data_Values
446
447```
448typedef struct OH_Data_Values OH_Data_Values
449```
450
451**Description**
452
453Defines the [OH_Data_Values](#oh_data_values) struct.
454
455**Since**: 18
456
457
458### OH_Data_VBuckets
459
460```
461typedef struct OH_Data_VBuckets OH_Data_VBuckets
462```
463
464**Description**
465
466Defines the **OH_Data_VBuckets** struct.
467
468**Since**: 18
469
470### OH_Rdb_Transaction
471
472```
473typedef struct OH_Rdb_Transaction OH_Rdb_Transaction
474```
475
476**Description**
477
478Defines the [OH_Rdb_Transaction](#oh_rdb_transaction) struct.
479
480**Since**: 18
481
482
483### OH_RDB_TransOptions
484
485```
486typedef struct OH_RDB_TransOptions OH_RDB_TransOptions
487```
488
489**Description**
490
491Defines the [OH_RDB_TransOptions](#oh_rdb_transoptions) struct.
492
493**Since**: 18
494
495
496### OH_RDB_TransType
497
498```
499typedef enum OH_RDB_TransType OH_RDB_TransType
500```
501
502**Description**
503
504Defines an enum for transaction types of an RDB store.
505
506**Since**: 18
507
508### Rdb_Tokenizer
509
510```
511typedef enum Rdb_Tokenizer Rdb_Tokenizer
512```
513
514**Description**
515
516Defines an enum for database tokenizer types.
517
518**Since**: 18
519
520### OH_Rdb_ConfigV2
521
522```
523typedef struct OH_Rdb_ConfigV2 OH_Rdb_ConfigV2
524```
525
526**Description**
527
528Defines a struct for the RDB store configuration. Different from [OH_Rdb_Config](_o_h___rdb___config.md), this struct does not expose its member variables externally. Methods are used to configure the properties of this struct.
529
530**Since**: 14
531
532
533### Rdb_DBType
534
535```
536typedef enum Rdb_DBType Rdb_DBType
537```
538
539**Description**
540
541Defines an enum for database kernel types.
542
543**Since**: 14
544
545### OH_Cursor
546
547```
548typedef struct OH_Cursor OH_Cursor
549```
550
551**Description**
552
553Defines a struct for a result set.
554
555APIs are provided to access the result set obtained by querying the RDB store.
556
557**Since**: 10
558
559
560### OH_OrderType
561
562```
563typedef enum OH_OrderType OH_OrderType
564```
565
566**Description**
567
568Defines an enum for sorting types.
569
570**Since**: 10
571
572
573### OH_Predicates
574
575```
576typedef struct OH_Predicates OH_Predicates
577```
578
579**Description**
580
581Defines a **predicates** object.
582
583**Since**: 10
584
585
586### OH_Rdb_ErrCode
587
588```
589typedef enum OH_Rdb_ErrCode OH_Rdb_ErrCode
590```
591
592**Description**
593
594Defines an enum for error codes.
595
596**Since**: 10
597
598
599### OH_Rdb_SecurityLevel
600
601```
602typedef enum OH_Rdb_SecurityLevel OH_Rdb_SecurityLevel
603```
604
605**Description**
606
607Defines an enum for RDB store security levels.
608
609**Since**: 10
610
611
612### OH_VBucket
613
614```
615typedef struct OH_VBucket OH_VBucket
616```
617
618**Description**
619
620Defines a struct for the types of the key and value in a KV pair.
621
622**Since**: 10
623
624
625### OH_VObject
626
627```
628typedef struct OH_VObject OH_VObject
629```
630
631**Description**
632
633Defines a struct for allowed data types.
634
635**Since**: 10
636
637
638### Rdb_BriefObserver
639
640```
641typedef void(* Rdb_BriefObserver) (void *context, const char *values[], uint32_t count)
642```
643
644**Description**
645
646Defines a callback used to return the device-cloud data change event.
647
648**Since**: 11
649
650**Parameters**
651
652| Name| Description|
653| -------- | -------- |
654| context | Pointer to the context of the data observer.|
655| values | Pointer to the accounts whose device-cloud data is changed.|
656| count | Number of accounts whose device-cloud data is changed.|
657
658
659### Rdb_ChangeInfo
660
661```
662typedef struct Rdb_ChangeInfo Rdb_ChangeInfo
663```
664
665**Description**
666
667Defines a struct for the details about the device-cloud sync process.
668
669**Since**: 11
670
671
672### Rdb_ChangeType
673
674```
675typedef enum Rdb_ChangeType Rdb_ChangeType
676```
677
678**Description**
679
680Defines an enum for data change types.
681
682**Since**: 11
683
684
685### Rdb_DataObserver
686
687```
688typedef struct Rdb_DataObserver Rdb_DataObserver
689```
690
691**Description**
692
693Defines a struct for the data observer.
694
695**Since**: 11
696
697
698### Rdb_DetailsObserver
699
700```
701typedef void(* Rdb_DetailsObserver) (void *context, const Rdb_ChangeInfo **changeInfo, uint32_t count)
702```
703
704**Description**
705
706Defines a callback used to return the details about the device-cloud data change.
707
708**Since**: 11
709
710**Parameters**
711
712| Name| Description|
713| -------- | -------- |
714| context | Pointer to the context of the data observer.|
715| changeInfo | Double pointer to [Rdb_ChangeInfo](_rdb___change_info.md).|
716| count | Number of changed tables.|
717
718**See**
719
720[Rdb_ChangeInfo](_rdb___change_info.md).
721
722
723### Rdb_DistributedConfig
724
725```
726typedef struct Rdb_DistributedConfig Rdb_DistributedConfig
727```
728
729**Description**
730
731Defines a struct for distributed configuration of a table.
732
733**Since**: 11
734
735
736### Rdb_DistributedType
737
738```
739typedef enum Rdb_DistributedType Rdb_DistributedType
740```
741
742**Description**
743
744Defines an enum for distributed types.
745
746**Since**: 11
747
748
749### Rdb_KeyInfo
750
751```
752typedef struct Rdb_KeyInfo Rdb_KeyInfo
753```
754
755**Description**
756
757Defines a struct for the primary key or number of the row that changes.
758
759**Since**: 11
760
761
762### Rdb_Progress
763
764```
765typedef enum Rdb_Progress Rdb_Progress
766```
767
768**Description**
769
770Defines an enum for device-cloud sync progress states.
771
772**Since**: 11
773
774
775### Rdb_ProgressCallback
776
777```
778typedef void(* Rdb_ProgressCallback) (void *context, Rdb_ProgressDetails *progressDetails)
779```
780
781**Description**
782
783Defines a callback used to return the device-cloud sync progress.
784
785**Since**: 11
786
787**Parameters**
788
789| Name| Description|
790| -------- | -------- |
791| progressDetails | Details about the device-cloud sync progress.|
792
793**See**
794
795[Rdb_ProgressDetails](_rdb___progress_details.md).
796
797
798### Rdb_ProgressCode
799
800```
801typedef enum Rdb_ProgressCode Rdb_ProgressCode
802```
803
804**Description**
805
806Defines an enum for device-cloud sync states.
807
808**Since**: 11
809
810
811### Rdb_ProgressDetails
812
813```
814typedef struct Rdb_ProgressDetails Rdb_ProgressDetails
815```
816
817**Description**
818
819Defines a struct for statistics of the overall device-cloud sync (upload and download) tasks of an RDB store.
820
821**Since**: 11
822
823
824### Rdb_ProgressObserver
825
826```
827typedef struct Rdb_ProgressObserver Rdb_ProgressObserver
828```
829
830**Description**
831
832Defines a struct for the observer for the device-cloud sync progress.
833
834**Since**: 11
835
836
837### Rdb_SecurityArea
838
839```
840typedef enum Rdb_SecurityArea Rdb_SecurityArea
841```
842
843**Description**
844
845Defines an enum for encryption levels of database files.
846
847**Since**: 11
848
849
850### Rdb_Statistic
851
852```
853typedef struct Rdb_Statistic Rdb_Statistic
854```
855
856**Description**
857
858Defines a struct for the device-cloud sync statistics of a database table.
859
860**Since**: 11
861
862
863### Rdb_SubscribeCallback
864
865```
866typedef union Rdb_SubscribeCallback Rdb_SubscribeCallback
867```
868
869**Description**
870
871Defines a callback used to return the subscribed event.
872
873**Since**: 11
874
875
876### Rdb_SubscribeType
877
878```
879typedef enum Rdb_SubscribeType Rdb_SubscribeType
880```
881
882**Description**
883
884Defines an enum for subscription types.
885
886**Since**: 11
887
888
889### Rdb_SyncCallback
890
891```
892typedef void(* Rdb_SyncCallback) (Rdb_ProgressDetails *progressDetails)
893```
894
895**Description**
896
897Defines a callback for device-cloud sync.
898
899**Since**: 11
900
901**Parameters**
902
903| Name| Description|
904| -------- | -------- |
905| progressDetails | Statistics of device-cloud sync.|
906
907**See**
908
909[OH_Rdb_Store](_o_h___rdb___store.md).
910
911
912### Rdb_SyncMode
913
914```
915typedef enum Rdb_SyncMode Rdb_SyncMode
916```
917
918**Description**
919
920Defines an enum for RDB store sync modes.
921
922**Since**: 11
923
924
925### Rdb_TableDetails
926
927```
928typedef struct Rdb_TableDetails Rdb_TableDetails
929```
930
931**Description**
932
933Defines a struct for statistics of device-cloud upload and download tasks of a database table.
934
935**Since**: 11
936
937## Enum Description
938
939### Rdb_ConflictResolution
940
941```
942enum Rdb_ConflictResolution
943```
944
945**Description**
946
947Enumerates the conflict resolution policies.
948
949**Since**: 18
950
951| Value| Description|
952| -------- | -------- |
953| RDB_CONFLICT_NONE | No operation is performed when a conflict occurs.|
954| RDB_CONFLICT_ROLLBACK | Throw an error and roll back the transaction.|
955| RDB_CONFLICT_ABORT | Throw an error and roll back the current change.|
956| RDB_CONFLICT_FAIL | Throw an error and abort the current change without rolling back the modifications before the conflict.|
957| RDB_CONFLICT_IGNORE | Ignore the conflicted data and resolve the conflict later.|
958| RDB_CONFLICT_REPLACE | Delete the data and then insert the data. If the conflict persists, apply **RDB_CONFLICT_ABORT**.|
959
960### OH_Rdb_ErrCode
961
962```
963enum OH_Rdb_ErrCode
964```
965
966**Description**
967
968Enumerates the error codes.
969
970**Since**: 10
971
972| Value| Description|
973| -------- | -------- |
974| RDB_ERR | Execution failed.|
975| RDB_OK | Execution successful.|
976| E_BASE | Base of the error code.|
977| RDB_E_NOT_SUPPORTED | The RDB store does not have this capability.|
978| RDB_E_ERROR | Common exception.|
979| RDB_E_INVALID_ARGS | Invalid parameter.|
980| RDB_E_CANNOT_UPDATE_READONLY | Failed to update data because the RDB store is read-only.|
981| RDB_E_REMOVE_FILE | Failed to delete the file.|
982| RDB_E_EMPTY_TABLE_NAME | The table name is empty.|
983| RDB_E_EMPTY_VALUES_BUCKET | The content of the KV pair is empty.|
984| RDB_E_EXECUTE_IN_STEP_QUERY | The SQL statement executed during the query is incorrect.|
985| RDB_E_INVALID_COLUMN_INDEX | The column index is invalid.|
986| RDB_E_INVALID_COLUMN_TYPE | The column type is invalid.|
987| RDB_E_EMPTY_FILE_NAME | The file name is empty.|
988| RDB_E_INVALID_FILE_PATH | The file path is invalid.|
989| RDB_E_TRANSACTION_IN_EXECUTE | Failed to start the transaction.|
990| RDB_E_INVALID_STATEMENT | Failed to precompile the SQL statements.|
991| RDB_E_EXECUTE_WRITE_IN_READ_CONNECTION | Failed to perform a write operation in a read connection.|
992| RDB_E_BEGIN_TRANSACTION_IN_READ_CONNECTION | Failed to start the transaction in a read connection.|
993| RDB_E_NO_TRANSACTION_IN_SESSION | The transaction to start does not exist in the database session.|
994| RDB_E_MORE_STEP_QUERY_IN_ONE_SESSION | Multiple queries are executed in a database session.|
995| RDB_E_NO_ROW_IN_QUERY | The result set does not contain any record.|
996| RDB_E_INVALID_BIND_ARGS_COUNT | The number of parameters bound in the SQL statement is invalid.|
997| RDB_E_INVALID_OBJECT_TYPE | The object type is invalid.|
998| RDB_E_INVALID_CONFLICT_FLAG | The conflict resolution type is invalid.|
999| RDB_E_HAVING_CLAUSE_NOT_IN_GROUP_BY | The **HAVING** keyword can be used only after **GROUP BY**.|
1000| RDB_E_NOT_SUPPORTED_BY_STEP_RESULT_SET | The result set by step is not supported.|
1001| RDB_E_STEP_RESULT_SET_CROSS_THREADS | Failed to obtain the result set.|
1002| RDB_E_STEP_RESULT_QUERY_NOT_EXECUTED | The result set query statement is not executed.|
1003| RDB_E_STEP_RESULT_IS_AFTER_LAST | The pointer of the result set is already in the last row.|
1004| RDB_E_STEP_RESULT_QUERY_EXCEEDED | The number of result set query times exceeds the limit.|
1005| RDB_E_STATEMENT_NOT_PREPARED | The SQL statement is not precompiled.|
1006| RDB_E_EXECUTE_RESULT_INCORRECT | The database execution result is incorrect.|
1007| RDB_E_STEP_RESULT_CLOSED | The result set has been closed.|
1008| RDB_E_RELATIVE_PATH | The file path is a relative path.|
1009| RDB_E_EMPTY_NEW_ENCRYPT_KEY | The new encrypt key is empty.|
1010| RDB_E_CHANGE_UNENCRYPTED_TO_ENCRYPTED | The RDB store is non-encrypted and cannot be changed.|
1011| RDB_E_CHANGE_ENCRYPT_KEY_IN_BUSY | The database does not respond when the database key is updated.|
1012| RDB_E_STEP_STATEMENT_NOT_INIT | The precompiled SQL statement is not initialized.|
1013| RDB_E_NOT_SUPPORTED_ATTACH_IN_WAL_MODE | The WAL mode does not support the ATTACH operation.|
1014| RDB_E_CREATE_FOLDER_FAIL | Failed to create the folder.|
1015| RDB_E_SQLITE_SQL_BUILDER_NORMALIZE_FAIL | Failed to build the SQL statement.|
1016| RDB_E_STORE_SESSION_NOT_GIVE_CONNECTION_TEMPORARILY | The database session does not provide a connection.|
1017| RDB_E_STORE_SESSION_NO_CURRENT_TRANSACTION | The transaction does not exist in the database session.|
1018| RDB_E_NOT_SUPPORT | The current operation is not supported.|
1019| RDB_E_INVALID_PARCEL | The current PARCEL is invalid.|
1020| RDB_E_QUERY_IN_EXECUTE | Failed to execute query.|
1021| RDB_E_SET_PERSIST_WAL | Failed to set the persistence of the database file in WAL mode.|
1022| RDB_E_DB_NOT_EXIST | The database does not exist.|
1023| RDB_E_ARGS_READ_CON_OVERLOAD | The number of read connections to set is greater than the limit.|
1024| RDB_E_WAL_SIZE_OVER_LIMIT | The WAL log file size exceeds the default value.|
1025| RDB_E_CON_OVER_LIMIT | The number of database connections has reached the limit.|
1026| RDB_E_ALREADY_CLOSED<sup>18+</sup> | The RDB store is already closed.|
1027| RDB_E_DATABASE_BUSY<sup>18+</sup> | The database does not respond.|
1028| RDB_E_SQLITE_CORRUPT<sup>18+</sup> | The database is corrupted.|
1029| RDB_E_SQLITE_PERM<sup>18+</sup> | SQLite: access denied.|
1030| RDB_E_SQLITE_BUSY<sup>18+</sup> | SQLite: database file locked.|
1031| RDB_E_SQLITE_LOCKED<sup>18+</sup> | SQLite: database table locked.|
1032| RDB_E_SQLITE_NOMEM<sup>18+</sup> | SQLite: insufficient database memory.|
1033| RDB_E_SQLITE_READONLY<sup>18+</sup> | SQLite: attempt to write a read-only database.|
1034| RDB_E_SQLITE_IOERR<sup>18+</sup> | SQLite: disk I/O error.|
1035| RDB_E_SQLITE_FULL<sup>18+</sup> | SQLite: database is full.|
1036| RDB_E_SQLITE_CANT_OPEN<sup>18+</sup> | SQLite: unable to open the database file.|
1037| RDB_E_SQLITE_TOO_BIG<sup>18+</sup> | SQLite: TEXT or BLOB exceeds the limit.|
1038| RDB_E_SQLITE_MISMATCH<sup>18+</sup> | SQLite: data types mismatch.|
1039| RDB_E_DATA_TYPE_NULL<sup>18+</sup> | The data to be stored is empty.|
1040| RDB_E_TYPE_MISMATCH<sup>18+</sup> | The data type is incorrect.|
1041| RDB_E_SQLITE_CONSTRAINT<sup>18+</sup> | SQLite error code: SQLite constraint.|
1042
1043### OH_ColumnType
1044
1045```
1046enum OH_ColumnType
1047```
1048
1049**Description**
1050
1051Enumerates the column data types.
1052
1053**Since**: 10
1054
1055| Value| Description|
1056| -------- | -------- |
1057| TYPE_NULL | NULL.|
1058| TYPE_INT64 | INT64.|
1059| TYPE_REAL | REAL.|
1060| TYPE_TEXT | TEXT.|
1061| TYPE_BLOB | BLOB.|
1062| TYPE_ASSET<sup>11+</sup> | ASSET (asset attachment).|
1063| TYPE_ASSETS<sup>11+</sup> | ASSETS (multiple asset attachments).|
1064| TYPE_FLOAT_VECTOR<sup>18+</sup> | FLOAT VECTOR.|
1065| TYPE_UNLIMITED_INT<sup>18+</sup> | Number longer than 64 digits.|
1066
1067### OH_RDB_TransType
1068
1069```
1070enum OH_RDB_TransType
1071```
1072
1073**Description**
1074
1075Enumerates the transaction types of an RDB store.
1076
1077**Since**: 18
1078
1079| Value| Description|
1080| -------- | -------- |
1081| RDB_TRANS_DEFERRED | Do not start any transaction before the database is accessed for the first time.|
1082| RDB_TRANS_IMMEDIATE | Start new writes without waiting for the write statement once the database is connected.|
1083| RDB_TRANS_EXCLUSIVE | Start the write transaction immediately, similar to **RDB_TRANS_IMMEDIATE**. In WAL mode, **RDB_TRANS_EXCLUSIVE** is the same as **RDB_TRANS_IMMEDIATE**. In other log modes, **RDB_TRANS_EXCLUSIVE** prevents other database connections when the transaction is reading the database.|
1084| RDB_TRANS_BUTT | Maximum value of the RDB transaction type.|
1085
1086### Rdb_Tokenizer
1087
1088```
1089enum Rdb_Tokenizer
1090```
1091
1092**Description**
1093
1094Enumerates the database tokenizer types.
1095
1096**Since**: 18
1097
1098| Value| Description|
1099| -------- | -------- |
1100| RDB_NONE_TOKENIZER | No tokenizer is used.|
1101| RDB_ICU_TOKENIZER | Native ICU tokenizer.|
1102| RDB_CUSTOM_TOKENIZER | Custom tokenizer.|
1103
1104### Rdb_DBType
1105
1106```
1107enum Rdb_DBType
1108```
1109
1110**Description**
1111
1112Enumerates the database kernel types.
1113
1114**Since**: 14
1115
1116| Value| Description|
1117| -------- | -------- |
1118| RDB_SQLITE | SQLite is used as the database kernel.|
1119| RDB_CAYLEY | Cayley is used as the database kernel.|
1120| DBTYPE_BUTT | Maximum value of the database kernel type, which is an invalid value.|
1121
1122### OH_Rdb_SecurityLevel
1123
1124```
1125enum OH_Rdb_SecurityLevel
1126```
1127
1128**Description**
1129
1130Enumerates the RDB store security levels.
1131
1132**Since**: 10
1133
1134| Value| Description|
1135| -------- | -------- |
1136| S1 | Low security level.<br>If data leakage occurs, minor impact will be caused.|
1137| S2 | Medium security level.<br>If data leakage occurs, moderate impact will be caused.|
1138| S3 | High security level.<br>If data leakage occurs, major impact will be caused.|
1139| S4 | Critical security level.<br>If data leakage occurs, critical impact will be caused.|
1140
1141
1142### Rdb_ChangeType
1143
1144```
1145enum Rdb_ChangeType
1146```
1147
1148**Description**
1149
1150Enumerates the data change types.
1151
1152**Since**: 11
1153
1154| Value| Description|
1155| -------- | -------- |
1156| RDB_DATA_CHANGE | Data change.|
1157| RDB_ASSET_CHANGE | Asset change.|
1158
1159
1160### Rdb_DistributedType
1161
1162```
1163enum Rdb_DistributedType
1164```
1165
1166**Description**
1167
1168Enumerates the distributed types.
1169
1170**Since**: 11
1171
1172| Value| Description|
1173| -------- | -------- |
1174| RDB_DISTRIBUTED_CLOUD | Distributed database tables for device-cloud sync.|
1175
1176
1177### Rdb_Progress
1178
1179```
1180enum Rdb_Progress
1181```
1182
1183**Description**
1184
1185Enumerates the device-cloud sync progress states.
1186
1187**Since**: 11
1188
1189| Value| Description|
1190| -------- | -------- |
1191| RDB_SYNC_BEGIN | The device-cloud sync starts.|
1192| RDB_SYNC_IN_PROGRESS | The device-cloud sync is in progress.|
1193| RDB_SYNC_FINISH | The device-cloud sync is finished.|
1194
1195
1196### Rdb_ProgressCode
1197
1198```
1199enum Rdb_ProgressCode
1200```
1201
1202**Description**
1203
1204Enumerates the device-cloud sync state codes.
1205
1206**Since**: 11
1207
1208| Value| Description|
1209| -------- | -------- |
1210| RDB_SUCCESS | The device-cloud sync is successful.|
1211| RDB_UNKNOWN_ERROR | An unknown error occurs during the device-cloud sync.|
1212| RDB_NETWORK_ERROR | A network error occurs during the device-cloud sync.|
1213| RDB_CLOUD_DISABLED | The cloud is unavailable.|
1214| RDB_LOCKED_BY_OTHERS | The device-cloud sync of another device is being performed.|
1215| RDB_RECORD_LIMIT_EXCEEDED | The number of records or size of the data to be synced exceeds the maximum. The maximum value is configured on the cloud.|
1216| RDB_NO_SPACE_FOR_ASSET | The remaining cloud space is less than the size of the data to be synced.|
1217
1218
1219### Rdb_SecurityArea
1220
1221```
1222enum Rdb_SecurityArea
1223```
1224
1225**Description**
1226
1227Enumerates the encryption levels of database files.
1228
1229**Since**: 11
1230
1231| Value| Description|
1232| -------- | -------- |
1233| RDB_SECURITY_AREA_EL1 | Encryption level 1.|
1234| RDB_SECURITY_AREA_EL2 | Encryption level 2.|
1235| RDB_SECURITY_AREA_EL3 | Encryption level 3.|
1236| RDB_SECURITY_AREA_EL4 | Encryption level 4.|
1237
1238
1239### Rdb_SubscribeType
1240
1241```
1242enum Rdb_SubscribeType
1243```
1244
1245**Description**
1246
1247Enumerates the subscription types.
1248
1249**Since**: 11
1250
1251| Value| Description|
1252| -------- | -------- |
1253| RDB_SUBSCRIBE_TYPE_CLOUD | Subscribe to cloud data changes.|
1254| RDB_SUBSCRIBE_TYPE_CLOUD_DETAILS | Subscribe to cloud data change details.|
1255| RDB_SUBSCRIBE_TYPE_LOCAL_DETAILS<sup>12+</sup>  | Subscribe to details of the local data change. This value is available since API version 12.|
1256
1257
1258### Rdb_SyncMode
1259
1260```
1261enum Rdb_SyncMode
1262```
1263
1264**Description**
1265
1266Enumerates the RDB store sync modes.
1267
1268**Since**: 11
1269
1270| Value| Description|
1271| -------- | -------- |
1272| RDB_SYNC_MODE_TIME_FIRST | Synchronize with the data with the latest modification time.|
1273| RDB_SYNC_MODE_NATIVE_FIRST | Synchronize data from a local device to the cloud.|
1274| RDB_SYNC_MODE_CLOUD_FIRST | Synchronize data from the cloud to a local device.|
1275
1276
1277## Function Description
1278
1279### OH_RdbTrans_BatchInsert()
1280
1281```
1282int OH_RdbTrans_BatchInsert (OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, Rdb_ConflictResolution resolution, int64_t *changes)
1283```
1284
1285**Description**
1286
1287Inserts a batch of data into a table.
1288
1289**Since**: 18
1290
1291**Parameters**
1292
1293| Name| Description|
1294| -------- | -------- |
1295| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
1296| table | Pointer to the target table.|
1297| rows | Pointer to the rows of data to insert.|
1298| resolution | Policy used to resolve file conflicts.|
1299| changes | Pointer to the number of successful insertions.|
1300
1301**Returns**
1302
1303Returns the execution result.
1304
1305**RDB_OK** indicates that the operation is successful.
1306
1307**RDB_E_ERROR** indicates a common database error.
1308
1309**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1310
1311**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1312
1313**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1314
1315**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1316
1317**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1318
1319**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1320
1321**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1322
1323**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1324
1325**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1326
1327**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1328
1329**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1330
1331**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1332
1333**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1334
1335**RDB_E_SQLITE_CONSTRAINT** indicates an SQLite error code: SQLite constraint.
1336
1337
1338### OH_Rdb_BatchInsert()
1339
1340```
1341int OH_Rdb_BatchInsert (OH_Rdb_Store *store, const char *table, const OH_Data_VBuckets *rows, Rdb_ConflictResolution resolution, int64_t *changes )
1342```
1343
1344**Description**
1345
1346Inserts a batch of data into a table.
1347
1348**Since**: 18
1349
1350**Parameters**
1351
1352| Name| Description|
1353| -------- | -------- |
1354| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
1355| tables | Pointer to the names of the distributed tables to set.|
1356| rows | Pointer to the rows of data to insert.|
1357| resolution | Policy used to resolve file conflicts.|
1358| changes | Pointer to the number of successful insertions.|
1359
1360**Returns**
1361
1362Returns the execution result.
1363
1364**RDB_OK** indicates that the operation is successful.
1365
1366**RDB_E_ERROR** indicates a common database error.
1367
1368**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1369
1370**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1371
1372**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1373
1374**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1375
1376**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1377
1378**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1379
1380**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1381
1382**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1383
1384**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1385
1386**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1387
1388**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1389
1390**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1391
1392**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1393
1394**RDB_E_SQLITE_CONSTRAINT** indicates an SQLite error code: SQLite constraint.
1395
1396
1397### OH_Rdb_SetPersistent()
1398
1399```
1400int OH_Rdb_SetPersistent (OH_Rdb_ConfigV2 *config, bool isPersistent )
1401```
1402
1403**Description**
1404
1405Sets whether to persist an RDB store.
1406
1407**Parameters**
1408
1409| Name| Description|
1410| -------- | -------- |
1411| config | Pointer to the target **OH_Rdb_ConfigV2** instance, which specifies the database configuration.|
1412| isPersistent | Whether to persist the database data.|
1413
1414**Returns**
1415
1416Returns the status code of the execution. <br>**RDB_OK** indicates that the operation is successful. <br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
1417
1418### OH_Cursor_GetFloatVector()
1419
1420```
1421int OH_Cursor_GetFloatVector (OH_Cursor *cursor, int32_t columnIndex, float *val, size_t inLen, size_t *outLen )
1422```
1423
1424**Description**
1425
1426Obtains the value in a specified column of the current row in the form of a float array.
1427
1428**Since**: 18
1429
1430**Parameters**
1431
1432| Name| Description|
1433| -------- | -------- |
1434| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1435| columnIndex | Index of the column, which starts from **0**.|
1436| val | Ponter to the value obtained, in a float array. The caller needs to apply for the memory.|
1437| inLen | Length of the float array requested.|
1438| outLen | Pointer to the length of the value obtained.|
1439
1440**Returns**
1441
1442Returns the execution result.
1443
1444**RDB_OK** indicates that the operation is successful.
1445
1446**RDB_E_ERROR** indicates a common database error.
1447
1448**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1449
1450**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1451
1452**RDB_E_STEP_RESULT_CLOSED** indicates the result set is closed.
1453
1454**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1455
1456**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1457
1458**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1459
1460**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1461
1462**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1463
1464**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1465
1466**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit. **RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1467
1468**See**
1469
1470[OH_Cursor_GetFloatVectorCount](#oh_cursor_getfloatvectorcount).
1471
1472
1473### OH_Cursor_GetFloatVectorCount()
1474
1475```
1476int OH_Cursor_GetFloatVectorCount (OH_Cursor *cursor, int32_t columnIndex, size_t *length )
1477```
1478
1479**Description**
1480
1481Obtains the length of the float array in the specified column of the current row.
1482
1483**Since**: 18
1484
1485**Parameters**
1486
1487| Name| Description|
1488| -------- | -------- |
1489| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
1490| columnIndex | Index of the column, which starts from **0**.|
1491| length | Pointer to the length of the float array obtained.|
1492
1493**Returns**
1494
1495Returns the execution result.
1496
1497**RDB_OK** indicates that the operation is successful.
1498
1499**RDB_E_ERROR** indicates a common database error.
1500
1501**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1502
1503**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1504
1505**RDB_E_STEP_RESULT_CLOSED** indicates the result set is closed.
1506
1507**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1508
1509**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1510
1511**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1512
1513**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1514
1515**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1516
1517**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1518
1519**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1520
1521**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1522
1523### OH_Rdb_CreateTransaction()
1524
1525```
1526int OH_Rdb_CreateTransaction (OH_Rdb_Store *store, const OH_RDB_TransOptions *options, OH_Rdb_Transaction **trans )
1527```
1528
1529**Description**
1530
1531Creates a transaction object.
1532
1533**Since**: 18
1534
1535**Parameters**
1536
1537| Name| Description|
1538| -------- | -------- |
1539| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
1540| options | Pointer to the [OH_RDB_TransOptions](#oh_rdb_transoptions) instance for the transaction instance to create.|
1541| trans | Double pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance created if the operation is successful. If the operation fails, **nullptr** is returned. Call [OH_RdbTrans_Destroy](#oh_rdbtrans_destroy) to release the transaction instance that is no longer required.|
1542
1543**Returns**
1544
1545Returns the execution result.
1546
1547**RDB_OK** indicates that the operation is successful.
1548
1549**RDB_E_ERROR** indicates a common database error.
1550
1551**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1552
1553**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1554
1555**RDB_E_DATABASE_BUSY** indicates the database does not respond.
1556
1557**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1558
1559**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1560
1561**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1562
1563**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1564
1565**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1566
1567**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1568
1569**RDB_E_SQLITE_CANT_OPEN** indicates an SQLite error: unable to open the database file.
1570
1571**See**
1572
1573[OH_RdbTrans_Destroy](#oh_rdbtrans_destroy).
1574
1575
1576### OH_Rdb_ExecuteQueryV2()
1577
1578```
1579OH_Cursor *OH_Rdb_ExecuteQueryV2 (OH_Rdb_Store *store, const char *sql, const OH_Data_Values *args )
1580```
1581
1582**Description**
1583
1584Queries data in the database using the specified SQL statement. This API supports vector stores.
1585
1586**Since**: 18
1587
1588**Parameters**
1589
1590| Name| Description|
1591| -------- | -------- |
1592| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
1593| sql | Pointer to the SQL statement to execute.|
1594| args | Pointer to the **OH_Data_Values** instance. This parameter is optional.|
1595
1596**Returns**
1597
1598Returns a pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful. Release the [OH_Cursor](_o_h___cursor.md) instance that is no longer required in time. Returns **NULL** if the SQL statement is invalid or the memory allocation fails.
1599
1600**See**
1601
1602[OH_Rdb_Store](_o_h___rdb___store.md).
1603
1604
1605### OH_Rdb_ExecuteV2()
1606
1607```
1608int OH_Rdb_ExecuteV2 (OH_Rdb_Store *store, const char *sql, const OH_Data_Values *args, OH_Data_Value **result )
1609```
1610
1611**Description**
1612
1613Executes an SQL statement with a return value. This API supports vector stores.
1614
1615**Since**: 18
1616
1617**Parameters**
1618
1619| Name| Description|
1620| -------- | -------- |
1621| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
1622| sql | Pointer to the SQL statement to execute.|
1623| args | Pointer to the **OH_Data_Values** instance. This parameter is optional.|
1624| result | Double pointer to the [OH_Data_Value](#oh_data_value) instance returned if the operation is successful.<br>Use [OH_Value_Destroy](#oh_value_destroy) to release the memory in time.|
1625
1626**Returns**
1627
1628Returns the execution result.
1629
1630**RDB_OK** indicates that the operation is successful.
1631
1632**RDB_E_ERROR** indicates a common database error.
1633
1634**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1635
1636**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1637
1638**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1639
1640**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1641
1642**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1643
1644**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1645
1646**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1647
1648**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1649
1650**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1651
1652**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1653
1654**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1655
1656**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1657
1658**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1659
1660**See**
1661
1662[OH_Value_Destroy](#oh_value_destroy).
1663
1664
1665### OH_Rdb_IsTokenizerSupported()
1666
1667```
1668int OH_Rdb_IsTokenizerSupported (Rdb_Tokenizer tokenizer, bool *isSupported )
1669```
1670
1671**Description**
1672
1673Checks whether the specified tokenizer is supported.
1674
1675**Since**: 18
1676
1677**Parameters**
1678
1679| Name| Description|
1680| -------- | -------- |
1681| tokenizer | Tokenizer to check.|
1682| isSupported | Pointer to the check.<br>The value **true** means the tokenizer is supported; the value **false** means the opposite.|
1683
1684**Returns**
1685
1686Returns the operation status code.
1687
1688**RDB_OK** indicates that the operation is successful.
1689
1690**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1691
1692
1693### OH_Rdb_SetTokenizer()
1694
1695```
1696int OH_Rdb_SetTokenizer (OH_Rdb_ConfigV2 *config, Rdb_Tokenizer tokenizer )
1697```
1698
1699**Description**
1700
1701Sets the tokenizer type.
1702
1703**Since**: 18
1704
1705**Parameters**
1706
1707| Name| Description|
1708| -------- | -------- |
1709| config | Pointer to the target database configuration.|
1710| tokenizer | tokenizer type to set.|
1711
1712**Returns**
1713
1714Returns the operation status code.
1715
1716**RDB_OK** indicates that the operation is successful.
1717
1718**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1719
1720<br>**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
1721
1722### OH_RdbTrans_Commit()
1723
1724```
1725int OH_RdbTrans_Commit (OH_Rdb_Transaction *trans)
1726```
1727
1728**Description**
1729
1730Commits a transaction.
1731
1732**Since**: 18
1733
1734**Parameters**
1735
1736| Name| Description|
1737| -------- | -------- |
1738| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance to commit.|
1739
1740**Returns**
1741
1742Returns the execution result.
1743
1744**RDB_OK** indicates that the operation is successful.
1745
1746**RDB_E_ERROR** indicates a common database error.
1747
1748**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1749
1750**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1751
1752**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1753
1754**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1755
1756**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1757
1758**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1759
1760**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1761
1762**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1763
1764**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1765
1766### OH_RdbTrans_Delete()
1767
1768```
1769int OH_RdbTrans_Delete (OH_Rdb_Transaction *trans, const OH_Predicates *predicates, int64_t *changes )
1770```
1771
1772**Description**
1773
1774Deletes data from the database based on the specified conditions.
1775
1776**Since**: 18
1777
1778**Parameters**
1779
1780| Name| Description|
1781| -------- | -------- |
1782| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
1783| predicates | Pointer to the conditions specified by [OH_Predicates](_o_h___predicates.md).|
1784| changes | Pointer to the number of successful deletions.|
1785
1786**Returns**
1787
1788Returns the execution result.
1789
1790**RDB_OK** indicates that the operation is successful.
1791
1792**RDB_E_ERROR** indicates a common database error.
1793
1794**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1795
1796**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1797
1798**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1799
1800**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1801
1802**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1803
1804**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1805
1806**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1807
1808**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1809
1810**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1811
1812**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1813
1814**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1815
1816**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1817
1818**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1819
1820### OH_RdbTrans_CreateOptions()
1821
1822```
1823OH_RDB_TransOptions* OH_RdbTrans_CreateOptions (void )
1824```
1825
1826**Description**
1827
1828Creates a transaction configuration object.
1829
1830**Since**: 18
1831
1832**Returns**
1833
1834Returns the pointer to the [OH_RDB_TransOptions](#oh_rdb_transoptions) instance created if the operation is successful. Returns **nullptr** otherwise. Use [OH_RdbTrans_DestroyOptions](#oh_rdbtrans_destroyoptions) to release the memory in time.
1835
1836**See**
1837
1838[OH_RdbTrans_DestroyOptions](#oh_rdbtrans_destroyoptions).
1839
1840### OH_RdbTrans_Destroy()
1841
1842```
1843int OH_RdbTrans_Destroy (OH_Rdb_Transaction *trans)
1844```
1845
1846**Description**
1847
1848Destroys a transaction object.
1849
1850**Since**: 18
1851
1852**Parameters**
1853
1854| Name| Description|
1855| -------- | -------- |
1856| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance to destroy.|
1857
1858**Returns**
1859
1860Returns the operation status code.
1861
1862**RDB_OK** indicates that the operation is successful.
1863
1864**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1865
1866
1867### OH_RdbTrans_DestroyOptions()
1868
1869```
1870int OH_RdbTrans_DestroyOptions (OH_RDB_TransOptions *opitons)
1871```
1872
1873**Description**
1874
1875Destroys a **TransOptions** instance.
1876
1877**Since**: 18
1878
1879**Parameters**
1880
1881| Name| Description|
1882| -------- | -------- |
1883| opitons | Pointer to the [OH_RDB_TransOptions](#oh_rdb_transoptions) instance to destroy.|
1884
1885**Returns**
1886
1887Returns the operation status code.
1888
1889**RDB_OK** indicates that the operation is successful.
1890
1891**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1892
1893
1894### OH_RdbTrans_Execute()
1895
1896```
1897int OH_RdbTrans_Execute (OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args, OH_Data_Value **result )
1898```
1899
1900**Description**
1901
1902Executes an SQL statement that contains specified parameters.
1903
1904**Since**: 18
1905
1906**Parameters**
1907
1908| Name| Description|
1909| -------- | -------- |
1910| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
1911| sql | Pointer to the SQL statement to execute.|
1912| args | Pointer to the parameters contained in the SQL statement.|
1913| result | Pointer to the [OH_Data_Value](#oh_data_value) instance created if the execution is successful. Use [OH_Value_Destroy](#oh_value_destroy) to release the memory in time.|
1914
1915**Returns**
1916
1917Returns the execution result.
1918
1919**RDB_OK** indicates that the operation is successful.
1920
1921**RDB_E_ERROR** indicates a common database error.
1922
1923**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1924
1925**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1926
1927**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1928
1929**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1930
1931**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1932
1933**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1934
1935**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1936
1937**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1938
1939**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
1940
1941**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
1942
1943**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
1944
1945**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
1946
1947**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
1948
1949**See**
1950
1951[OH_Value_Destroy](#oh_value_destroy).
1952
1953
1954### OH_RdbTrans_Insert()
1955
1956```
1957int OH_RdbTrans_Insert (OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, int64_t *rowId )
1958```
1959
1960**Description**
1961
1962Inserts a row of data into a table.
1963
1964**Since**: 18
1965
1966**Parameters**
1967
1968| Name| Description|
1969| -------- | -------- |
1970| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
1971| table | Pointer to the target table.|
1972| row | Pointer to the row of data to insert.|
1973| rowId | Pointer to the row number returned.|
1974
1975**Returns**
1976
1977Returns the execution result.
1978
1979**RDB_OK** indicates that the operation is successful.
1980
1981**RDB_E_ERROR** indicates a common database error.
1982
1983**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
1984
1985**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
1986
1987**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
1988
1989**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
1990
1991**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
1992
1993**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
1994
1995**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
1996
1997**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
1998
1999**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
2000
2001**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
2002
2003**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
2004
2005**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
2006
2007**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
2008
2009### OH_RdbTrans_Query()
2010
2011```
2012OH_Cursor* OH_RdbTrans_Query (OH_Rdb_Transaction *trans, const OH_Predicates *predicates, const char *columns[], int len )
2013```
2014
2015**Description**
2016
2017Queries data in the database based on specified conditions.
2018
2019**Since**: 18
2020
2021**Parameters**
2022
2023| Name| Description|
2024| -------- | -------- |
2025| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
2026| predicates | Pointer to the query conditions specified by [OH_Predicates](_o_h___predicates.md).|
2027| columns | Pointer to the column to be queried. If the value is not specified, the query applies to all columns.|
2028| len | Number of elements in a column.|
2029
2030**Returns**
2031
2032Returns a pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful. Returns null if the database is closed or does not respond.
2033
2034
2035### OH_RdbTrans_QuerySql()
2036
2037```
2038OH_Cursor* OH_RdbTrans_QuerySql (OH_Rdb_Transaction *trans, const char *sql, const OH_Data_Values *args )
2039```
2040
2041**Description**
2042
2043Queries data in the database using the specified SQL statement.
2044
2045**Since**: 18
2046
2047**Parameters**
2048
2049| Name| Description|
2050| -------- | -------- |
2051| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
2052| sql | Pointer to the SQL statement to execute.|
2053| args | Pointer to [OH_Data_Values](#oh_data_values).|
2054
2055**Returns**
2056
2057Returns a pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful. Returns null if the database is closed or does not respond.
2058
2059
2060### OH_RdbTrans_Rollback()
2061
2062```
2063int OH_RdbTrans_Rollback (OH_Rdb_Transaction *trans)
2064```
2065
2066**Description**
2067
2068Rolls back a transaction.
2069
2070**Since**: 18
2071
2072**Parameters**
2073
2074| Name| Description|
2075| -------- | -------- |
2076| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance to roll back.|
2077
2078**Returns**
2079
2080Returns the execution result.
2081
2082**RDB_OK** indicates that the operation is successful.
2083
2084**RDB_E_ERROR** indicates a common database error.
2085
2086**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2087
2088**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
2089
2090**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
2091
2092**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
2093
2094**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
2095
2096**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
2097
2098**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
2099
2100**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
2101
2102**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
2103
2104
2105### OH_RdbTrans_Update()
2106
2107```
2108int OH_RdbTrans_Update (OH_Rdb_Transaction *trans, const OH_VBucket *row, const OH_Predicates *predicates, int64_t *changes )
2109```
2110
2111**Description**
2112
2113Updates data in an RDB store based on specified conditions.
2114
2115**Since**: 18
2116
2117**Parameters**
2118
2119| Name| Description|
2120| -------- | -------- |
2121| trans | Pointer to the [OH_Rdb_Transaction](#oh_rdb_transaction) instance.|
2122| row | Pointer to the row of data to update.|
2123| predicates | Pointer to the update condition specified by [OH_Predicates](_o_h___predicates.md).|
2124| changes | Pointer to the number of successful updates.|
2125
2126**Returns**
2127
2128Returns the execution result.
2129
2130**RDB_OK** indicates that the operation is successful.
2131
2132**RDB_E_ERROR** indicates a common database error.
2133
2134**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2135
2136**RDB_E_ALREADY_CLOSED** indicates that the database is already closed.
2137
2138**RDB_E_WAL_SIZE_OVER_LIMIT** indicates that the size of the WAL log file exceeds the default value.
2139
2140**RDB_E_SQLITE_FULL** indicates an SQLite error: the database is full.
2141
2142**RDB_E_SQLITE_CORRUPT** indicates that the database is corrupted.
2143
2144**RDB_E_SQLITE_PERM** indicates an SQLite error: access denied.
2145
2146**RDB_E_SQLITE_BUSY** indicates an SQLite error: database file locked.
2147
2148**RDB_E_SQLITE_LOCKED** indicates an SQLite error: database table locked.
2149
2150**RDB_E_SQLITE_NOMEM** indicates an SQLite: insufficient database memory.
2151
2152**RDB_E_SQLITE_READONLY** indicates an SQLite error: attempt to write a read-only database.
2153
2154**RDB_E_SQLITE_IOERR** indicates an SQLite: disk I/O error.
2155
2156**RDB_E_SQLITE_TOO_BIG** indicates an SQLite error: TEXT or BLOB exceeds the limit.
2157
2158**RDB_E_SQLITE_MISMATCH** indicates an SQLite error: data types mismatch.
2159
2160### OH_RdbTransOption_SetType()
2161
2162```
2163int OH_RdbTransOption_SetType (OH_RDB_TransOptions *opitons, OH_RDB_TransType type )
2164```
2165
2166**Description**
2167
2168Sets the transaction type of an RDB store.
2169
2170**Since**: 18
2171
2172**Parameters**
2173
2174| Name| Description|
2175| -------- | -------- |
2176| opitons | Pointer to the [OH_RDB_TransOptions](#oh_rdb_transoptions) instance.|
2177| type | Transaction type to set.|
2178
2179**Returns**
2180
2181Returns the operation status code.
2182
2183**RDB_OK** indicates that the operation is successful.
2184
2185**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2186
2187
2188### OH_Value_Create()
2189
2190```
2191OH_Data_Value* OH_Value_Create (void )
2192```
2193
2194**Description**
2195
2196Creates an [OH_Data_Value](#oh_data_value) instance to store a single KV pair.
2197
2198**Since**: 18
2199
2200**Returns**
2201
2202Returns the pointer to the [OH_Data_Value](#oh_data_value) instance created if the operation is successful; returns **nullptr** otherwise. Use [OH_Value_Destroy](#oh_value_destroy) to release the memory in time.
2203
2204**See**
2205
2206[OH_Value_Destroy](#oh_value_destroy).
2207
2208
2209### OH_Value_Destroy()
2210
2211```
2212int OH_Value_Destroy (OH_Data_Value *value)
2213```
2214
2215**Description**
2216
2217Destroys an [OH_Data_Value](#oh_data_value) instance.
2218
2219**Since**: 18
2220
2221**Parameters**
2222
2223| Name| Description|
2224| -------- | -------- |
2225| value | Pointer to the [OH_Data_Value](#oh_data_value) instance to destroy.|
2226
2227**Returns**
2228
2229Returns the operation status code.
2230
2231**RDB_OK** indicates that the operation is successful.
2232
2233**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2234
2235
2236### OH_Value_GetAsset()
2237
2238```
2239int OH_Value_GetAsset (OH_Data_Value *value, Data_Asset *val )
2240```
2241
2242**Description**
2243
2244Obtains the asset from an **OH_Data_Value** instance.
2245
2246**Since**: 18
2247
2248**Parameters**
2249
2250| Name| Description|
2251| -------- | -------- |
2252| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2253| val | Pointer to the **Data_Asset** object obtained if the operation is successful. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
2254
2255**Returns**
2256
2257Returns the operation status code.
2258
2259**RDB_OK** indicates that the operation is successful.
2260
2261**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2262
2263**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2264
2265**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2266
2267### OH_Value_GetAssets()
2268
2269```
2270int OH_Value_GetAssets (OH_Data_Value *value, Data_Asset **val, size_t inLen, size_t *outLen )
2271```
2272
2273**Description**
2274
2275Obtains the assets from an **OH_Data_Value** instance.
2276
2277**Since**: 18
2278
2279**Parameters**
2280
2281| Name| Description|
2282| -------- | -------- |
2283| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2284| val | Double pointer to the **Data_Asset** object obtained if the operation is successful. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
2285| inLen | Size of **val**, which can be obtained by [OH_Values_GetAssetsCount](#oh_values_getassetscount).|
2286| outLen | Pointer to the size of the obtained data.|
2287
2288**Returns**
2289
2290Returns the operation status code.
2291
2292**RDB_OK** indicates that the operation is successful.
2293
2294**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2295
2296**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2297
2298**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2299
2300**See**
2301
2302[OH_Value_GetAssetsCount](#oh_value_getassetscount).
2303
2304
2305### OH_Value_GetAssetsCount()
2306
2307```
2308int OH_Value_GetAssetsCount (OH_Data_Value *value, size_t *length )
2309```
2310
2311**Description**
2312
2313Obtains the length of the asset in an **OH_Data_Value** instance.
2314
2315**Since**: 18
2316
2317**Parameters**
2318
2319| Name| Description|
2320| -------- | -------- |
2321| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2322| length | Pointer to the ASSETS data length obtained.|
2323
2324**Returns**
2325
2326Returns the operation status code.
2327
2328**RDB_OK** indicates that the operation is successful.
2329
2330**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2331
2332**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2333
2334**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2335
2336
2337### OH_Value_GetBlob()
2338
2339```
2340int OH_Value_GetBlob (OH_Data_Value *value, const uint8_t **val, size_t *length )
2341```
2342
2343**Description**
2344
2345Obtains the BLOB data from an **OH_Data_Value** instance.
2346
2347**Since**: 18
2348
2349**Parameters**
2350
2351| Name| Description|
2352| -------- | -------- |
2353| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2354| val | Double pointer to the BLOB data obtained. You do not need to apply for or release memory for it. The lifecycle of **val** complies with the value of **index** in **value**.|
2355| length | Pointer to the length of the BLOB data obtained.|
2356
2357**Returns**
2358
2359Returns the operation status code.
2360
2361**RDB_OK** indicates that the operation is successful.
2362
2363**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2364
2365**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2366
2367**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2368
2369
2370### OH_Value_GetFloatVector()
2371
2372```
2373int OH_Value_GetFloatVector (OH_Data_Value *value, float *val, size_t inLen, size_t *outLen )
2374```
2375
2376**Description**
2377
2378Obtains the float array from an **OH_Data_Value** instance.
2379
2380**Since**: 18
2381
2382**Parameters**
2383
2384| Name| Description|
2385| -------- | -------- |
2386| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2387| val | Pointer to the float array obtained. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
2388| inLen | Size of **val**, which can be obtained by using [OH_Values_GetFloatVectorCount](#oh_values_getfloatvectorcount).|
2389| outLen | Pointer to the length of the obtained data.|
2390
2391**Returns**
2392
2393Returns the operation status code.
2394
2395**RDB_OK** indicates that the operation is successful.
2396
2397**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2398
2399**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2400
2401**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2402
2403**See**
2404
2405[OH_Value_GetFloatVectorCount](#oh_value_getfloatvectorcount).
2406
2407
2408### OH_Value_GetFloatVectorCount()
2409
2410```
2411int OH_Value_GetFloatVectorCount (OH_Data_Value *value, size_t *length )
2412```
2413
2414**Description**
2415
2416Obtains the length of a float array.
2417
2418**Since**: 18
2419
2420**Parameters**
2421
2422| Name| Description|
2423| -------- | -------- |
2424| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2425| length | Pointer to the length of the float data obtained.|
2426
2427**Returns**
2428
2429Returns the operation status code.
2430
2431**RDB_OK** indicates that the operation is successful.
2432
2433**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2434
2435**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2436
2437**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2438
2439
2440### OH_Value_GetInt()
2441
2442```
2443int OH_Value_GetInt (OH_Data_Value *value, int64_t *val )
2444```
2445
2446**Description**
2447
2448Obtains the integer from an **OH_Data_Value** instance.
2449
2450**Since**: 18
2451
2452**Parameters**
2453
2454| Name| Description|
2455| -------- | -------- |
2456| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2457| val | Pointer to the integer data obtained.|
2458
2459**Returns**
2460
2461Returns the operation status code.
2462
2463**RDB_OK** indicates that the operation is successful.
2464
2465**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2466
2467**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2468
2469**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2470
2471
2472### OH_Value_GetReal()
2473
2474```
2475int OH_Value_GetReal (OH_Data_Value *value, double *val )
2476```
2477
2478**Description**
2479
2480Obtains the REAL data from an **OH_Data_Value** instance.
2481
2482**Since**: 18
2483
2484**Parameters**
2485
2486| Name| Description|
2487| -------- | -------- |
2488| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2489| val | Pointer to the REAL data obtained.|
2490
2491**Returns**
2492
2493Returns the operation status code.
2494
2495**RDB_OK** indicates that the operation is successful.
2496
2497**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2498
2499**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2500
2501**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2502
2503
2504### OH_Value_GetText()
2505
2506```
2507int OH_Value_GetText (OH_Data_Value *value, const char **val )
2508```
2509
2510**Description**
2511
2512Obtains the string from an **OH_Data_Value** instance.
2513
2514**Since**: 18
2515
2516**Parameters**
2517
2518| Name| Description|
2519| -------- | -------- |
2520| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2521| val | Double pointer to the string obtained. You do not need to apply for or release memory for it. The lifecycle of **val** complies with the value of **index** in **value**.|
2522
2523**Returns**
2524
2525Returns the operation status code.
2526
2527**RDB_OK** indicates that the operation is successful.
2528
2529**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2530
2531**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2532
2533**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2534
2535### OH_Value_GetType()
2536
2537```
2538int OH_Value_GetType (OH_Data_Value *value, OH_ColumnType *type )
2539```
2540
2541**Description**
2542
2543Obtains the data type.
2544
2545**Since**: 18
2546
2547**Parameters**
2548
2549| Name| Description|
2550| -------- | -------- |
2551| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2552| type | Pointer to the data type obtained.|
2553
2554**Returns**
2555
2556Returns the operation status code.
2557
2558**RDB_OK** indicates that the operation is successful.
2559
2560**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2561
2562
2563### OH_Value_GetUnlimitedInt()
2564
2565```
2566int OH_Value_GetUnlimitedInt (OH_Data_Value *value, int *sign, uint64_t *trueForm, size_t inLen, size_t *outLen )
2567```
2568
2569**Description**
2570
2571Obtains the unlimited integer from an **OH_Data_Value** instance.
2572
2573**Since**: 18
2574
2575**Parameters**
2576
2577| Name| Description|
2578| -------- | -------- |
2579| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2580| sign | Pointer to the sign notation of the data obtained. The value **0** indicates a positive integer, and **1** indicates a negative integer.|
2581| trueForm | Pointer to the integer array obtained. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
2582| inLen | **trueForm** length, which can be obtained by using [OH_Values_GetUnlimitedIntBand](#oh_values_getunlimitedintband).|
2583| outLen | Pointer to the length of the obtained data.|
2584
2585**Returns**
2586
2587Returns the operation status code.
2588
2589**RDB_OK** indicates that the operation is successful.
2590
2591**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2592
2593**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2594
2595**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2596
2597**See**
2598
2599[OH_Value_GetUnlimitedIntBand](#oh_value_getunlimitedintband).
2600
2601
2602### OH_Value_GetUnlimitedIntBand()
2603
2604```
2605int OH_Value_GetUnlimitedIntBand (OH_Data_Value *value, size_t *length )
2606```
2607
2608**Description**
2609
2610Obtains the length of the unlimited integer from an **OH_Data_Value** instance.
2611
2612**Since**: 18
2613
2614**Parameters**
2615
2616| Name| Description|
2617| -------- | -------- |
2618| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2619| length | Pointer to the length of the integer obtained.|
2620
2621**Returns**
2622
2623Returns the operation status code.
2624
2625**RDB_OK** indicates that the operation is successful.
2626
2627**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2628
2629**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
2630
2631**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
2632
2633### OH_Value_IsNull()
2634
2635```
2636int OH_Value_IsNull (OH_Data_Value *value, bool *val )
2637```
2638
2639**Description**
2640
2641Checks whether a value is null.
2642
2643**Since**: 18
2644
2645**Parameters**
2646
2647| Name| Description|
2648| -------- | -------- |
2649| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2650| val | Pointer to a boolean value, which indicates whether the data is null. The value **true** means the data is null; the value **false** means the opposite.|
2651
2652**Returns**
2653
2654Returns the operation status code.
2655
2656**RDB_OK** indicates that the operation is successful.
2657
2658**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2659
2660
2661### OH_Value_PutAsset()
2662
2663```
2664int OH_Value_PutAsset (OH_Data_Value *value, const Data_Asset *val )
2665```
2666
2667**Description**
2668
2669Adds an asset to an **OH_Data_Value** instance.
2670
2671**Since**: 18
2672
2673**Parameters**
2674
2675| Name| Description|
2676| -------- | -------- |
2677| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2678| val | Pointer to the **Data_Asset** object to add.|
2679
2680**Returns**
2681
2682Returns the operation status code.
2683
2684**RDB_OK** indicates that the operation is successful.
2685
2686**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2687
2688
2689### OH_Value_PutAssets()
2690
2691```
2692int OH_Value_PutAssets (OH_Data_Value *value, const Data_Asset * const * val, size_t length )
2693```
2694
2695**Description**
2696
2697Adds assets to an **OH_Data_Value** instance.
2698
2699**Since**: 18
2700
2701**Parameters**
2702
2703| Name| Description|
2704| -------- | -------- |
2705| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2706| val | Pointer to the **Data_Asset** object to add.|
2707| length | Number of elements in the **Data_Asset** array.|
2708
2709**Returns**
2710
2711Returns the operation status code.
2712
2713**RDB_OK** indicates that the operation is successful.
2714
2715**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2716
2717
2718### OH_Value_PutBlob()
2719
2720```
2721int OH_Value_PutBlob (OH_Data_Value *value, const unsigned char *val, size_t length )
2722```
2723
2724**Description**
2725
2726Adds BLOB data to an **OH_Data_Value** instance.
2727
2728**Since**: 18
2729
2730**Parameters**
2731
2732| Name| Description|
2733| -------- | -------- |
2734| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2735| val | Pointer to the BLOB data to add.|
2736| length | Length of the BLOB data to add.|
2737
2738**Returns**
2739
2740Returns the operation status code.
2741
2742**RDB_OK** indicates that the operation is successful.
2743
2744**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2745
2746
2747### OH_Value_PutFloatVector()
2748
2749```
2750int OH_Value_PutFloatVector (OH_Data_Value *value, const float *val, size_t length )
2751```
2752
2753**Description**
2754
2755Adds a float array to an **OH_Data_Value** instance.
2756
2757**Since**: 18
2758
2759**Parameters**
2760
2761| Name| Description|
2762| -------- | -------- |
2763| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2764| val | Pointer to the float array to add.|
2765| length | Length of the float array to add.|
2766
2767**Returns**
2768
2769Returns the operation status code.
2770
2771**RDB_OK** indicates that the operation is successful.
2772
2773**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2774
2775### OH_Value_PutInt()
2776
2777```
2778int OH_Value_PutInt (OH_Data_Value *value, int64_t val )
2779```
2780
2781**Description**
2782
2783Add integer data.
2784
2785**Since**: 18
2786
2787**Parameters**
2788
2789| Name| Description|
2790| -------- | -------- |
2791| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2792| val | Pointer to the integer data to add.|
2793
2794**Returns**
2795
2796Returns the operation status code.
2797
2798**RDB_OK** indicates that the operation is successful.
2799
2800**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2801
2802
2803### OH_Value_PutNull()
2804
2805```
2806int OH_Value_PutNull (OH_Data_Value *value)
2807```
2808
2809**Description**
2810
2811Adds empty data to an **OH_Data_Value** instance.
2812
2813**Since**: 18
2814
2815**Parameters**
2816
2817| Name| Description|
2818| -------- | -------- |
2819| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2820
2821**Returns**
2822
2823Returns the operation status code.
2824
2825**RDB_OK** indicates that the operation is successful.
2826
2827**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2828
2829
2830### OH_Value_PutReal()
2831
2832```
2833int OH_Value_PutReal (OH_Data_Value *value, double val )
2834```
2835
2836**Description**
2837
2838Adds REAL data to an **OH_Data_Value** instance.
2839
2840**Since**: 18
2841
2842**Parameters**
2843
2844| Name| Description|
2845| -------- | -------- |
2846| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2847| val | Pointer to the REAL data to add.|
2848
2849**Returns**
2850
2851Returns the operation status code.
2852
2853**RDB_OK** indicates that the operation is successful.
2854
2855**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2856
2857
2858### OH_Value_PutText()
2859
2860```
2861int OH_Value_PutText (OH_Data_Value *value, const char *val )
2862```
2863
2864**Description**
2865
2866Adds a string to an **OH_Data_Value** instance.
2867
2868**Since**: 18
2869
2870**Parameters**
2871
2872| Name| Description|
2873| -------- | -------- |
2874| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2875| val | Pointer to the string to add.|
2876
2877**Returns**
2878
2879Returns the operation status code.
2880
2881**RDB_OK** indicates that the operation is successful.
2882
2883**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2884
2885
2886### OH_Value_PutUnlimitedInt()
2887
2888```
2889int OH_Value_PutUnlimitedInt (OH_Data_Value *value, int sign, const uint64_t *trueForm, size_t length )
2890```
2891
2892**Description**
2893
2894Adds an integer array of any length to an **OH_Data_Value** instance.
2895
2896**Since**: 18
2897
2898**Parameters**
2899
2900| Name| Description|
2901| -------- | -------- |
2902| value | Pointer to the target [OH_Data_Value](#oh_data_value) instance.|
2903| sign | Sign notation of the integer array to add. The value **0** indicates a positive integer, and the value **1** indicates a negative integer.|
2904| trueForm | Pointer to the integer array to add.|
2905| length | Length of the integer array to add.|
2906
2907**Returns**
2908
2909Returns the operation status code.
2910
2911**RDB_OK** indicates that the operation is successful.
2912
2913**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2914
2915### OH_Values_Count()
2916
2917```
2918int OH_Values_Count (OH_Data_Values *values, size_t *count )
2919```
2920
2921**Description**
2922
2923Obtains the number of records in an [OH_Data_Values](#oh_data_values) instance.
2924
2925**Since**: 18
2926
2927**Parameters**
2928
2929| Name| Description|
2930| -------- | -------- |
2931| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
2932| count | Pointer to the number of records obtained.|
2933
2934**Returns**
2935
2936Returns the operation status code.
2937
2938**RDB_OK** indicates that the operation is successful.
2939
2940**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2941
2942
2943### OH_Values_Create()
2944
2945```
2946OH_Data_Values* OH_Values_Create (void )
2947```
2948
2949**Description**
2950
2951Creates an [OH_Data_Values](#oh_data_values) instance to store multiple KV pairs.
2952
2953**Since**: 18
2954
2955**Returns**
2956
2957Returns the pointer to the [OH_Data_Values](#oh_data_values) instance if the operation is successful; returns **nullptr** otherwise. Use [OH_Values_Destroy](#oh_values_destroy) to release the memory in time.
2958
2959**See**
2960
2961[OH_Values_Destroy](#oh_values_destroy).
2962
2963
2964### OH_Values_Destroy()
2965
2966```
2967int OH_Values_Destroy (OH_Data_Values *values)
2968```
2969
2970**Description**
2971
2972Destroys an [OH_Data_Values](#oh_data_values) instance.
2973
2974**Since**: 18
2975
2976**Parameters**
2977
2978| Name| Description|
2979| -------- | -------- |
2980| values | Pointer to the [OH_Data_Values](#oh_data_values) instance to destroy.|
2981
2982**Returns**
2983
2984Returns the operation status code.
2985
2986**RDB_OK** indicates that the operation is successful.
2987
2988**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
2989
2990
2991### OH_Values_Get()
2992
2993```
2994int OH_Values_Get (OH_Data_Values *values, int index, OH_Data_Value **val )
2995```
2996
2997**Description**
2998
2999Obtains data of the **OH_Data_Value** type.
3000
3001**Since**: 18
3002
3003**Parameters**
3004
3005| Name| Description|
3006| -------- | -------- |
3007| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3008| index | Index of the value to obtain, which starts from 0 in **values**.|
3009| val | Double pointer to the [OH_Data_Value](#oh_data_value) instance obtained. You do not need to apply for or release memory for it.|
3010
3011**Returns**
3012
3013Returns the operation status code.
3014
3015**RDB_OK** indicates that the operation is successful.
3016
3017**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3018
3019### OH_Values_GetAsset()
3020
3021```
3022int OH_Values_GetAsset (OH_Data_Values *values, int index, Data_Asset *val )
3023```
3024
3025**Description**
3026
3027Obtains the asset from an **OH_Data_Values** instance.
3028
3029**Since**: 18
3030
3031**Parameters**
3032
3033| Name| Description|
3034| -------- | -------- |
3035| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3036| index | Index of the value to obtain, which starts from 0 in **values**.|
3037| val | Pointer to the **Data_Asset** object obtained if the operation is successful. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
3038
3039**Returns**
3040
3041Returns the operation status code.
3042
3043**RDB_OK** indicates that the operation is successful.
3044
3045**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3046
3047**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3048
3049**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3050
3051
3052### OH_Values_GetAssets()
3053
3054```
3055int OH_Values_GetAssets (OH_Data_Values *values, int index, Data_Asset **val, size_t inLen, size_t *outLen )
3056```
3057
3058**Description**
3059
3060Obtains the assets from an **OH_Data_Values** instance.
3061
3062**Since**: 18
3063
3064**Parameters**
3065
3066| Name| Description|
3067| -------- | -------- |
3068| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3069| index | Index of the value to obtain, which starts from 0 in **values**.|
3070| val | Double pointer to the **Data_Asset** object obtained if the operation is successful. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
3071| inLen | Size of **val**, which can be obtained by [OH_Values_GetAssetsCount](#oh_values_getassetscount).|
3072| outLen | Pointer to the length of the obtained data.|
3073
3074**Returns**
3075
3076Returns the operation status code.
3077
3078**RDB_OK** indicates that the operation is successful.
3079
3080**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3081
3082**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3083
3084**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3085
3086**See**
3087
3088[OH_Values_GetAssetsCount](#oh_values_getassetscount).
3089
3090
3091### OH_Values_GetAssetsCount()
3092
3093```
3094int OH_Values_GetAssetsCount (OH_Data_Values *values, int index, size_t *length )
3095```
3096
3097**Description**
3098
3099Obtains the length of the asset in an **OH_Data_Values** instance.
3100
3101**Since**: 18
3102
3103**Parameters**
3104
3105| Name| Description|
3106| -------- | -------- |
3107| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance. Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3108| index | Index of the value to obtain, which starts from 0 in **values**.|
3109| length | Pointer to the length of the ASSETS data obtained.|
3110
3111**Returns**
3112
3113Returns the operation status code.
3114
3115**RDB_OK** indicates that the operation is successful.
3116
3117**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3118
3119**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3120
3121**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3122
3123
3124### OH_Values_GetBlob()
3125
3126```
3127int OH_Values_GetBlob (OH_Data_Values *values, int index, const uint8_t **val, size_t *length )
3128```
3129
3130**Description**
3131
3132Obtains the BLOB data from an **OH_Data_Values** instance.
3133
3134**Since**: 18
3135
3136**Parameters**
3137
3138| Name| Description|
3139| -------- | -------- |
3140| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3141| index | Index of the value to obtain, which starts from 0 in **values**.|
3142| val | Double pointer to the BLOB data obtained. You do not need to apply for or release memory for it. The lifecycle of **val** complies with the value of **index** in **values**.|
3143| length | Pointer to the length of the BLOB data obtained.|
3144
3145**Returns**
3146
3147Returns the operation status code.
3148
3149**RDB_OK** indicates that the operation is successful.
3150
3151**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3152
3153**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3154
3155**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3156
3157### OH_Values_GetFloatVector()
3158
3159```
3160int OH_Values_GetFloatVector (OH_Data_Values *values, int index, float *val, size_t inLen, size_t *outLen )
3161```
3162
3163**Description**
3164
3165Obtains the float array from an **OH_Data_Values** instance.
3166
3167**Since**: 18
3168
3169**Parameters**
3170
3171| Name| Description|
3172| -------- | -------- |
3173| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3174| index | Index of the value to obtain, which starts from 0 in **values**.|
3175| val | Pointer to the float array obtained. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
3176| inLen | Size of **val**, which can be obtained by using [OH_Values_GetFloatVectorCount](#oh_values_getfloatvectorcount).|
3177| outLen | Pointer to the length of the obtained data.|
3178
3179**Returns**
3180
3181Returns the operation status code.
3182
3183**RDB_OK** indicates that the operation is successful.
3184
3185**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3186
3187**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3188
3189**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3190
3191**See**
3192
3193[OH_Values_GetFloatVectorCount](#oh_values_getfloatvectorcount).
3194
3195
3196### OH_Values_GetFloatVectorCount()
3197
3198```
3199int OH_Values_GetFloatVectorCount (OH_Data_Values *values, int index, size_t *length )
3200```
3201
3202**Description**
3203
3204Obtains the length of the float array in an **OH_Data_Values** instance.
3205
3206**Since**: 18
3207
3208**Parameters**
3209
3210| Name| Description|
3211| -------- | -------- |
3212| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3213| index | Index of the value to obtain, which starts from 0 in **values**.|
3214| length | Pointer to the length of the float data obtained.|
3215
3216**Returns**
3217
3218Returns the operation status code.
3219
3220**RDB_OK** indicates that the operation is successful.
3221
3222**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3223
3224**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3225
3226**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3227
3228
3229### OH_Values_GetInt()
3230
3231```
3232int OH_Values_GetInt (OH_Data_Values *values, int index, int64_t *val )
3233```
3234
3235**Description**
3236
3237Obtains the integer from an **OH_Data_Values** instance.
3238
3239**Since**: 18
3240
3241**Parameters**
3242
3243| Name| Description|
3244| -------- | -------- |
3245| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3246| index | Index of the value to obtain, which starts from 0 in **values**.|
3247| val | Pointer to the integer data obtained.|
3248
3249**Returns**
3250
3251Returns the operation status code.
3252
3253**RDB_OK** indicates that the operation is successful.
3254
3255**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3256
3257**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3258
3259**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3260
3261### OH_Values_GetReal()
3262
3263```
3264int OH_Values_GetReal (OH_Data_Values *values, int index, double *val )
3265```
3266
3267**Description**
3268
3269Obtains the REAL data from an **OH_Data_Values** instance.
3270
3271**Since**: 18
3272
3273**Parameters**
3274
3275| Name| Description|
3276| -------- | -------- |
3277| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3278| index | Index of the value to obtain, which starts from 0 in **values**.|
3279| val | Pointer to the REAL data obtained.|
3280
3281**Returns**
3282
3283Returns the operation status code.
3284
3285**RDB_OK** indicates that the operation is successful.
3286
3287**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3288
3289**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3290
3291**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3292
3293
3294### OH_Values_GetText()
3295
3296```
3297int OH_Values_GetText (OH_Data_Values *values, int index, const char **val )
3298```
3299
3300**Description**
3301
3302Obtains the string from an **OH_Data_Values** instance.
3303
3304**Since**: 18
3305
3306**Parameters**
3307
3308| Name| Description|
3309| -------- | -------- |
3310| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3311| index | Index of the value to obtain, which starts from 0 in **values**.|
3312| val | Double pointer to the string obtained. You do not need to apply for or release memory for it. The lifecycle of **val** complies with the value of **index** in **values**.|
3313
3314**Returns**
3315
3316Returns the operation status code.
3317
3318**RDB_OK** indicates that the operation is successful.
3319
3320**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3321
3322**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3323
3324**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3325
3326
3327### OH_Values_GetType()
3328
3329```
3330int OH_Values_GetType (OH_Data_Values *values, int index, OH_ColumnType *type )
3331```
3332
3333**Description**
3334
3335Obtains the data type.
3336
3337**Since**: 18
3338
3339**Parameters**
3340
3341| Name| Description|
3342| -------- | -------- |
3343| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3344| index | Index of the value to obtain, which starts from 0 in **values**.|
3345| type | Pointer to the data type obtained.|
3346
3347**Returns**
3348
3349Returns the operation status code.
3350
3351**RDB_OK** indicates that the operation is successful.
3352
3353**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3354
3355
3356### OH_Values_GetUnlimitedInt()
3357
3358```
3359int OH_Values_GetUnlimitedInt (OH_Data_Values *values, int index, int *sign, uint64_t *trueForm, size_t inLen, size_t *outLen )
3360```
3361
3362**Description**
3363
3364Obtains the unlimited integer from an **OH_Data_Values** instance.
3365
3366**Since**: 18
3367
3368**Parameters**
3369
3370| Name| Description|
3371| -------- | -------- |
3372| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3373| index | Index of the value to obtain, which starts from 0 in **values**.|
3374| sign | Pointer to the sign notation of the data obtained. The value **0** indicates a positive integer, and **1** indicates a negative integer.|
3375| trueForm | Pointer to the integer array obtained. You need to apply for memory for it. This function is used to fill in data only. Otherwise, the operation fails.|
3376| inLen | **trueForm** length, which can be obtained by using [OH_Values_GetUnlimitedIntBand](#oh_values_getunlimitedintband).|
3377| outLen | Pointer to the length of the obtained data.|
3378
3379**Returns**
3380
3381Returns the operation status code.
3382
3383**RDB_OK** indicates that the operation is successful.
3384
3385**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3386
3387**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3388
3389**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3390
3391**See**
3392
3393[OH_Values_GetUnlimitedIntBand](#oh_values_getunlimitedintband).
3394
3395
3396### OH_Values_GetUnlimitedIntBand()
3397
3398```
3399int OH_Values_GetUnlimitedIntBand (OH_Data_Values *values, int index, size_t *length )
3400```
3401
3402**Description**
3403
3404Obtains the length of the unlimited integer from an **OH_Data_Values** instance.
3405
3406**Since**: 18
3407
3408**Parameters**
3409
3410| Name| Description|
3411| -------- | -------- |
3412| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3413| index | Index of the value to obtain, which starts from 0 in **values**.|
3414| length | Pointer to the length of the integer obtained.|
3415
3416**Returns**
3417
3418Returns the operation status code.
3419
3420**RDB_OK** indicates that the operation is successful.
3421
3422**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3423
3424**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.
3425
3426**RDB_E_TYPE_MISMATCH** indicates the data types do not match.
3427
3428
3429### OH_Values_IsNull()
3430
3431```
3432int OH_Values_IsNull (OH_Data_Values *values, int index, bool *val )
3433```
3434
3435**Description**
3436
3437Checks whether a value is null.
3438
3439**Since**: 18
3440
3441**Parameters**
3442
3443| Name| Description|
3444| -------- | -------- |
3445| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3446| index | Index of the value to check, which starts from 0 in **values**.|
3447| val | Pointer to a boolean value, which indicates whether the data is null. The value **true** means the data is null; the value **false** means the opposite.|
3448
3449**Returns**
3450
3451Returns the operation status code.
3452
3453**RDB_OK** indicates that the operation is successful.
3454
3455**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3456
3457### OH_Values_Put()
3458
3459```
3460int OH_Values_Put (OH_Data_Values *values, const OH_Data_Value *val )
3461```
3462
3463**Description**
3464
3465Adds data of the **OH_Data_Value** type to an **OH_Data_Values** instance.
3466
3467**Since**: 18
3468
3469**Parameters**
3470
3471| Name| Description|
3472| -------- | -------- |
3473| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3474| val | Pointer to the [OH_Data_Value](#oh_data_value) object to add.|
3475
3476**Returns**
3477
3478Returns the operation status code.
3479
3480**RDB_OK** indicates that the operation is successful.
3481
3482**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3483
3484
3485### OH_Values_PutAsset()
3486
3487```
3488int OH_Values_PutAsset (OH_Data_Values *values, const Data_Asset *val )
3489```
3490
3491**Description**
3492
3493Adds an asset to an **OH_Data_Values** instance.
3494
3495**Since**: 18
3496
3497**Parameters**
3498
3499| Name| Description|
3500| -------- | -------- |
3501| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3502| val | Pointer to the **Data_Asset** object to add.|
3503
3504**Returns**
3505
3506Returns the operation status code.
3507
3508**RDB_OK** indicates that the operation is successful.
3509
3510**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3511
3512
3513### OH_Values_PutAssets()
3514
3515```
3516int OH_Values_PutAssets (OH_Data_Values *values, const Data_Asset * const * val, size_t length )
3517```
3518
3519**Description**
3520
3521Adds assets to an **OH_Data_Values** instance.
3522
3523**Since**: 18
3524
3525**Parameters**
3526
3527| Name| Description|
3528| -------- | -------- |
3529| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3530| val | Pointer to the **Data_Asset** object to add.|
3531| length | Number of elements in the **Data_Asset** object to add.|
3532
3533**Returns**
3534
3535Returns the operation status code.
3536
3537**RDB_OK** indicates that the operation is successful.
3538
3539**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3540
3541
3542### OH_Values_PutBlob()
3543
3544```
3545int OH_Values_PutBlob (OH_Data_Values *values, const unsigned char *val, size_t length )
3546```
3547
3548**Description**
3549
3550Adds BLOB data to an **OH_Data_Values** instance.
3551
3552**Since**: 18
3553
3554**Parameters**
3555
3556| Name| Description|
3557| -------- | -------- |
3558| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3559| val | Pointer to the BLOB data to add.|
3560| length | Length of the BLOB data to add.|
3561
3562**Returns**
3563
3564Returns the operation status code.
3565
3566**RDB_OK** indicates that the operation is successful.
3567
3568**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3569
3570
3571### OH_Values_PutFloatVector()
3572
3573```
3574int OH_Values_PutFloatVector (OH_Data_Values *values, const float *val, size_t length )
3575```
3576
3577**Description**
3578
3579Adds a float array to an **OH_Data_Values** instance.
3580
3581**Since**: 18
3582
3583**Parameters**
3584
3585| Name| Description|
3586| -------- | -------- |
3587| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3588| val | Pointer to the float array to add.|
3589| length | Length of the float array to add.|
3590
3591**Returns**
3592
3593Returns the operation status code.
3594
3595**RDB_OK** indicates that the operation is successful.
3596
3597**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3598
3599
3600### OH_Values_PutInt()
3601
3602```
3603int OH_Values_PutInt (OH_Data_Values *values, int64_t val )
3604```
3605
3606**Description**
3607
3608Adds an integer to an **OH_Data_Values** instance.
3609
3610**Since**: 18
3611
3612**Parameters**
3613
3614| Name| Description|
3615| -------- | -------- |
3616| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3617| val | Pointer to the integer to add.|
3618
3619**Returns**
3620
3621Returns the operation status code.
3622
3623**RDB_OK** indicates that the operation is successful.
3624
3625**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3626
3627
3628### OH_Values_PutNull()
3629
3630```
3631int OH_Values_PutNull (OH_Data_Values *values)
3632```
3633
3634**Description**
3635
3636Adds empty data to an **OH_Data_Values** instance.
3637
3638**Since**: 18
3639
3640**Parameters**
3641
3642| Name| Description|
3643| -------- | -------- |
3644| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3645
3646**Returns**
3647
3648Returns the operation status code.
3649
3650**RDB_OK** indicates that the operation is successful.
3651
3652**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3653
3654
3655### OH_Values_PutReal()
3656
3657```
3658int OH_Values_PutReal (OH_Data_Values *values, double val )
3659```
3660
3661**Description**
3662
3663Adds REAL data to an **OH_Data_Values** instance.
3664
3665**Since**: 18
3666
3667**Parameters**
3668
3669| Name| Description|
3670| -------- | -------- |
3671| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3672| val | Pointer to the REAL data to add.|
3673
3674**Returns**
3675
3676Returns the operation status code.
3677
3678**RDB_OK** indicates that the operation is successful.
3679
3680**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3681
3682
3683### OH_Values_PutText()
3684
3685```
3686int OH_Values_PutText (OH_Data_Values *values, const char *val )
3687```
3688
3689**Description**
3690
3691Adds a string to an **OH_Data_Values** instance.
3692
3693**Since**: 18
3694
3695**Parameters**
3696
3697| Name| Description|
3698| -------- | -------- |
3699| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3700| val | Pointer to the string to add.|
3701
3702**Returns**
3703
3704Returns the operation status code.
3705
3706**RDB_OK** indicates that the operation is successful.
3707
3708**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3709
3710
3711### OH_Values_PutUnlimitedInt()
3712
3713```
3714int OH_Values_PutUnlimitedInt (OH_Data_Values *values, int sign, const uint64_t *trueForm, size_t length )
3715```
3716
3717**Description**
3718
3719Adds an integer array of any length to an **OH_Data_Values** instance.
3720
3721**Since**: 18
3722
3723**Parameters**
3724
3725| Name| Description|
3726| -------- | -------- |
3727| values | Pointer to the target [OH_Data_Values](#oh_data_values) instance.|
3728| sign | Sign notation of the integer array to add. The value **0** indicates a positive integer, and the value **1** indicates a negative integer.|
3729| trueForm | Pointer to the integer array to add.|
3730| length | Length of the integer array to add.|
3731
3732**Returns**
3733
3734Returns the operation status code.
3735
3736**RDB_OK** indicates that the operation is successful.
3737
3738**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3739
3740### OH_VBucket_PutFloatVector()
3741
3742```
3743int OH_VBucket_PutFloatVector (OH_VBucket *bucket, const char *field, const float *vec, size_t len )
3744```
3745
3746**Description**
3747
3748Puts a float array into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
3749
3750**Since**: 18
3751
3752**Parameters**
3753
3754| Name| Description|
3755| -------- | -------- |
3756| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
3757| field | Pointer to the column name in the database table.|
3758| vec | Pointer to the float array to put.|
3759| len | Length of the float array to put.|
3760
3761**Returns**
3762
3763Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
3764
3765**RDB_OK** indicates that the operation is successful.
3766
3767**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3768
3769**See**
3770
3771[OH_VBucket](_o_h___v_bucket.md).
3772
3773
3774### OH_VBucket_PutUnlimitedInt()
3775
3776```
3777int OH_VBucket_PutUnlimitedInt (OH_VBucket *bucket, const char *field, int sign, const uint64_t *trueForm, size_t len )
3778```
3779
3780**Description**
3781
3782Puts an integer of any length into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
3783
3784**Since**: 18
3785
3786**Parameters**
3787
3788| Name| Description|
3789| -------- | -------- |
3790| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
3791| field | Pointer to the column name in the database table.|
3792| sign | Sing notation of the integer object. The value **0** indicates a positive integer, and the value **1** indicates a negative integer.|
3793| trueForm | Pointer to the integer object to put.|
3794| len | Length of the integer object to put.|
3795
3796**Returns**
3797
3798Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
3799
3800**RDB_OK** indicates that the operation is successful.
3801
3802**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3803
3804**See**
3805
3806[OH_VBucket](_o_h___v_bucket.md).
3807
3808
3809### OH_VBuckets_Create()
3810
3811```
3812OH_Data_VBuckets* OH_VBuckets_Create (void)
3813```
3814
3815**Description**
3816
3817Creates an **OH_Data_VBuckets** instance.
3818
3819**Since**: 18
3820
3821**Returns**
3822
3823Returns the pointer to the [OH_Data_VBuckets](#oh_data_vbuckets) instance if the operation is successful; returns **nullptr** otherwise. Use [OH_VBuckets_Destroy](#oh_vbuckets_destroy) to release the memory in time.
3824
3825**See**
3826
3827[OH_VBuckets_Destroy](#oh_vbuckets_destroy).
3828
3829
3830### OH_VBuckets_Destroy()
3831
3832```
3833int OH_VBuckets_Destroy (OH_Data_VBuckets *buckets)
3834```
3835
3836**Description**
3837
3838Destroys an **OH_Data_VBuckets** instance.
3839
3840**Since**: 18
3841
3842**Parameters**
3843
3844| Name| Description|
3845| -------- | -------- |
3846| buckets | Pointer to the [OH_Data_VBuckets](#oh_data_vbuckets) instance to destroy.|
3847
3848**Returns**
3849
3850Returns the operation status code.
3851
3852**RDB_OK** indicates that the operation is successful.
3853
3854**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3855
3856
3857### OH_VBuckets_PutRow()
3858
3859```
3860int OH_VBuckets_PutRow (OH_Data_VBuckets *buckets, const OH_VBucket *row )
3861```
3862
3863**Description**
3864
3865Adds data of the **OH_VBucket** type.
3866
3867**Since**: 18
3868
3869**Parameters**
3870
3871| Name| Description|
3872| -------- | -------- |
3873| buckets | Pointer to the target [OH_Data_VBuckets](#oh_data_vbuckets) instance.|
3874| row | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance to add.|
3875
3876**Returns**
3877
3878Returns the operation status code.
3879
3880**RDB_OK** indicates that the operation is successful.
3881
3882**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3883
3884
3885### OH_VBuckets_PutRows()
3886
3887```
3888int OH_VBuckets_PutRows (OH_Data_VBuckets *buckets, const OH_Data_VBuckets *rows )
3889```
3890
3891**Description**
3892
3893Adds data of the **OH_Data_VBuckets** type.
3894
3895**Since**: 18
3896
3897**Parameters**
3898
3899| Name| Description|
3900| -------- | -------- |
3901| buckets | Pointer to the target [OH_Data_VBuckets](#oh_data_vbuckets) instance.|
3902| rows | Pointer to the [OH_Data_VBuckets](#oh_data_vbuckets) instance to add.|
3903
3904**Returns**
3905
3906Returns the operation status code.
3907
3908**RDB_OK** indicates that the operation is successful.
3909
3910**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3911
3912
3913### OH_VBuckets_RowCount()
3914
3915```
3916int OH_VBuckets_RowCount (OH_Data_VBuckets *buckets, size_t *count )
3917```
3918
3919**Description**
3920
3921Obtains the number of **OH_VBuckets** in **OH_Data_VBuckets**.
3922
3923**Since**: 18
3924
3925**Parameters**
3926
3927| Name| Description|
3928| -------- | -------- |
3929| buckets | Pointer to the target [OH_Data_VBuckets](#oh_data_vbuckets) instance.|
3930| count | Pointer to the number of [OH_VBuckets](_o_h___v_bucket.md) in [OH_Data_VBuckets](#oh_data_vbuckets) obtained.|
3931
3932**Returns**
3933
3934Returns the operation status code.
3935
3936**RDB_OK** indicates that the operation is successful.
3937
3938**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3939
3940### OH_Rdb_CreateOrOpen()
3941
3942```
3943OH_Rdb_Store *OH_Rdb_CreateOrOpen (const OH_Rdb_ConfigV2 *config, int *errCode )
3944```
3945
3946**Description**
3947
3948Creates or opens an [OH_Rdb_Store](_o_h___rdb___store.md) instance based on the given [OH_Rdb_ConfigV2](#oh_rdb_configv2).
3949
3950**Since**: 14
3951
3952**Parameters**
3953
3954| Name| Description|
3955| -------- | -------- |
3956| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
3957| errCode | Pointer to the execution result of this API. **RDB_OK** indicates that the operation is successful. <br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
3958
3959**Returns**
3960
3961Returns the pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance created if the operation is successful; returns null otherwise.
3962
3963**See**
3964
3965[OH_Rdb_ConfigV2](#oh_rdb_configv2), [OH_Rdb_Store](_o_h___rdb___store.md).
3966
3967
3968### OH_Rdb_BeginTransWithTrxId()
3969
3970```
3971int OH_Rdb_BeginTransWithTrxId (OH_Rdb_Store *store, int64_t *trxId )
3972```
3973
3974**Description**
3975
3976Begins a transaction. This API returns a transaction ID. This API supports only vector stores.
3977
3978**Since**: 14
3979
3980**Parameters**
3981
3982| Name| Description|
3983| -------- | -------- |
3984| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
3985| trxId | Pointer to the transaction ID returned.|
3986
3987**Returns**
3988
3989Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
3990
3991**RDB_OK** indicates that the operation is successful.
3992
3993**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
3994
3995**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
3996
3997**See**
3998
3999[OH_Rdb_Store](_o_h___rdb___store.md).
4000
4001
4002### OH_Rdb_CommitByTrxId()
4003
4004```
4005int OH_Rdb_CommitByTrxId (OH_Rdb_Store *store, int64_t trxId )
4006```
4007
4008**Description**
4009
4010Commits the executed SQL statements based on the specified transaction ID. This API supports only vector stores.
4011
4012**Since**: 14
4013
4014**Parameters**
4015
4016| Name| Description|
4017| -------- | -------- |
4018| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4019| trxId | Transaction ID.|
4020
4021**Returns**
4022
4023Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4024
4025**RDB_OK** indicates that the operation is successful. <br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>Possible causes: A null pointer is passed in; the transaction ID is not obtained by [OH_Rdb_BeginTransWithTrxId](#oh_rdb_begintranswithtrxid); the transaction ID has been used by [OH_Rdb_CommitByTrxId](#oh_rdb_commitbytrxid); the transaction ID has been used by [OH_Rdb_RollBackByTrxId](#oh_rdb_rollbackbytrxid).
4026
4027<br>**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
4028
4029**See**
4030
4031[OH_Rdb_Store](_o_h___rdb___store.md).
4032
4033
4034### OH_Rdb_CreateConfig()
4035
4036```
4037OH_Rdb_ConfigV2 *OH_Rdb_CreateConfig ()
4038```
4039
4040**Description**
4041
4042Creates an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4043
4044**Since**: 14
4045
4046**Returns**
4047
4048Returns a pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance created.
4049
4050**See**
4051
4052[OH_Rdb_ConfigV2](#oh_rdb_configv2)
4053
4054
4055
4056### OH_Rdb_DeleteStoreV2()
4057
4058```
4059int OH_Rdb_DeleteStoreV2 (const OH_Rdb_ConfigV2 *config)
4060```
4061
4062**Description**
4063
4064Deletes an RDB store based on the given [OH_Rdb_ConfigV2](#oh_rdb_configv2). For a vector store, ensure that the vector store is correctly closed before calling this API.
4065
4066**Since**: 14
4067
4068**Parameters**
4069
4070| Name| Description|
4071| -------- | -------- |
4072| config | Pointer to the database configuration.|
4073
4074**Returns**
4075
4076Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4077
4078**RDB_OK** indicates that the operation is successful.
4079
4080**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4081
4082**See**
4083
4084OH_Rdb_ErrCode.
4085
4086
4087### OH_Rdb_DestroyConfig()
4088
4089```
4090int OH_Rdb_DestroyConfig (OH_Rdb_ConfigV2 *config)
4091```
4092
4093**Description**
4094
4095Destroys an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4096
4097**Since**: 14
4098
4099**Parameters**
4100
4101| Name| Description|
4102| -------- | -------- |
4103| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4104
4105**Returns**
4106
4107Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4108
4109**RDB_OK** indicates that the operation is successful.
4110
4111**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4112
4113
4114### OH_Rdb_ExecuteByTrxId()
4115
4116```
4117int OH_Rdb_ExecuteByTrxId (OH_Rdb_Store *store, int64_t trxId, const char *sql )
4118```
4119
4120**Description**
4121
4122Executes an SQL statement that returns no value based on the specified transaction ID. This API supports only vector stores.
4123
4124**Since**: 14
4125
4126**Parameters**
4127
4128| Name| Description|
4129| -------- | -------- |
4130| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4131| trxId | Transaction ID returned by [OH_Rdb_BeginTransWithTrxId](#oh_rdb_begintranswithtrxid). The value **0** indicates that no transaction is enabled.|
4132| sql | Pointer to the SQL statement to execute.|
4133
4134**Returns**
4135
4136Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4137
4138**RDB_OK** indicates that the operation is successful.
4139
4140<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>Possible causes: A null pointer is passed in; the transaction ID is not obtained by [OH_Rdb_BeginTransWithTrxId](#oh_rdb_begintranswithtrxid); the transaction ID has been used by [OH_Rdb_CommitByTrxId](#oh_rdb_commitbytrxid); the transaction ID has been used by [OH_Rdb_RollBackByTrxId](#oh_rdb_rollbackbytrxid); **store** or **sql** is **NULL**.
4141
4142<br>**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
4143
4144**See**
4145
4146[OH_Rdb_Store](_o_h___rdb___store.md).
4147
4148
4149### OH_Rdb_GetSupportedDbType()
4150
4151```
4152const int *OH_Rdb_GetSupportedDbType (int *typeCount)
4153```
4154
4155**Description**
4156
4157Obtains the supported database types.
4158
4159**Since**: 14
4160
4161**Parameters**
4162
4163| Name| Description|
4164| -------- | -------- |
4165| typeCount | Pointer to the length of the array of the supported database types obtained.|
4166
4167**Returns**
4168
4169Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4170
4171**RDB_OK** indicates that the operation is successful.
4172
4173**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4174
4175
4176### OH_Rdb_RollBackByTrxId()
4177
4178```
4179int OH_Rdb_RollBackByTrxId (OH_Rdb_Store *store, int64_t trxId )
4180```
4181
4182**Description**
4183
4184Rolls back the executed SQL statements based on the specified transaction ID. This API supports only vector stores.
4185
4186**Since**: 14
4187
4188**Parameters**
4189
4190| Name| Description|
4191| -------- | -------- |
4192| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4193| trxId | ID of the transaction to be rolled back.|
4194
4195**Returns**
4196
4197Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4198
4199**RDB_OK** indicates that the operation is successful.
4200
4201<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>Possible causes: A null pointer is passed in; the transaction ID is not obtained by [OH_Rdb_BeginTransWithTrxId](#oh_rdb_begintranswithtrxid); the transaction ID has been used by [OH_Rdb_CommitByTrxId](#oh_rdb_commitbytrxid); the transaction ID has been used by [OH_Rdb_RollBackByTrxId](#oh_rdb_rollbackbytrxid).
4202
4203<br>**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
4204
4205**See**
4206
4207[OH_Rdb_Store](_o_h___rdb___store.md).
4208
4209
4210### OH_Rdb_SetArea()
4211
4212```
4213int OH_Rdb_SetArea (OH_Rdb_ConfigV2 *config, int area )
4214```
4215
4216**Description**
4217
4218Sets the [Rdb_SecurityArea](#rdb_securityarea) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4219
4220**Since**: 14
4221
4222**Parameters**
4223
4224| Name| Description|
4225| -------- | -------- |
4226| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4227| area | Database file encryption level to set. For details, see [Rdb_SecurityArea](#rdb_securityarea).|
4228
4229**Returns**
4230
4231Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4232
4233**RDB_OK** indicates that the operation is successful.
4234
4235**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4236
4237
4238### OH_Rdb_SetBundleName()
4239
4240```
4241int OH_Rdb_SetBundleName (OH_Rdb_ConfigV2 *config, const char *bundleName )
4242```
4243
4244**Description**
4245
4246Sets the application bundle name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4247
4248**Since**: 14
4249
4250**Parameters**
4251
4252| Name| Description|
4253| -------- | -------- |
4254| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4255| bundleName | Pointer to the application bundle name to set.|
4256
4257**Returns**
4258
4259Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4260
4261**RDB_OK** indicates that the operation is successful.
4262
4263**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4264
4265
4266### OH_Rdb_SetDatabaseDir()
4267
4268```
4269int OH_Rdb_SetDatabaseDir (OH_Rdb_ConfigV2 *config, const char *databaseDir )
4270```
4271
4272**Description**
4273
4274Sets the database file path for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4275
4276**Since**: 14
4277
4278**Parameters**
4279
4280| Name| Description|
4281| -------- | -------- |
4282| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4283| dataBaseDir | Pointer to the database file path to set. The full path, including the RDB store name, cannot exceed a maximum of 1024 characters.|
4284
4285**Returns**
4286
4287Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4288
4289**RDB_OK** indicates that the operation is successful.
4290
4291**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4292
4293
4294### OH_Rdb_SetDbType()
4295
4296```
4297int OH_Rdb_SetDbType (OH_Rdb_ConfigV2 *config, int dbType )
4298```
4299
4300**Description**
4301
4302Sets the [Rdb_DBType](#rdb_dbtype) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4303
4304**Since**: 14
4305
4306**Parameters**
4307
4308| Name| Description|
4309| -------- | -------- |
4310| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4311| dbType | Database type to set. For details, see [Rdb_DBType](#rdb_dbtype).|
4312
4313**Returns**
4314
4315Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4316
4317**RDB_OK** indicates that the operation is successful.
4318
4319**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4320
4321<br>**RDB_E_NOT_SUPPORTED** indicates that the current operation is not supported.
4322
4323
4324### OH_Rdb_SetEncrypted()
4325
4326```
4327int OH_Rdb_SetEncrypted (OH_Rdb_ConfigV2 *config, bool isEncrypted )
4328```
4329
4330**Description**
4331
4332Sets whether to encrypt the RDB store for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4333
4334**Since**: 14
4335
4336**Parameters**
4337
4338| Name| Description|
4339| -------- | -------- |
4340| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4341| isEncrypted | Whether to encrypt the RDB store. The value **true** means to encrypt the database, the value **false** means the opposite.|
4342
4343**Returns**
4344
4345Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4346
4347**RDB_OK** indicates that the operation is successful.
4348
4349**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4350
4351
4352### OH_Rdb_SetModuleName()
4353
4354```
4355int OH_Rdb_SetModuleName (OH_Rdb_ConfigV2 *config, const char *moduleName )
4356```
4357
4358**Description**
4359
4360Sets the module name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4361
4362**Since**: 14
4363
4364**Parameters**
4365
4366| Name| Description|
4367| -------- | -------- |
4368| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4369| moduleName | Pointer to the module name to set.|
4370
4371**Returns**
4372
4373Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4374
4375**RDB_OK** indicates that the operation is successful.
4376
4377**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4378
4379
4380### OH_Rdb_SetSecurityLevel()
4381
4382```
4383int OH_Rdb_SetSecurityLevel (OH_Rdb_ConfigV2 *config, int securityLevel )
4384```
4385
4386**Description**
4387
4388Sets the [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4389
4390**Since**: 14
4391
4392**Parameters**
4393
4394| Name| Description|
4395| -------- | -------- |
4396| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4397| securityLevel | RDB store security level to set. For details, see [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel).|
4398
4399**Returns**
4400
4401Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4402
4403**RDB_OK** indicates that the operation is successful.
4404
4405**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4406
4407
4408### OH_Rdb_SetStoreName()
4409
4410```
4411int OH_Rdb_SetStoreName (OH_Rdb_ConfigV2 *config, const char *storeName )
4412```
4413
4414**Description**
4415
4416Sets the RDB store name for an [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance.
4417
4418**Since**: 14
4419
4420**Parameters**
4421
4422| Name| Description|
4423| -------- | -------- |
4424| config | Pointer to the [OH_Rdb_ConfigV2](#oh_rdb_configv2) instance, which is the configuration of the RDB store.|
4425| storeName | Pointer to the RDB store name to set.|
4426
4427**Returns**
4428
4429Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4430
4431**RDB_OK** indicates that the operation is successful.
4432
4433**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4434
4435### OH_Rdb_Backup()
4436
4437```
4438int OH_Rdb_Backup (OH_Rdb_Store *store, const char *databasePath )
4439```
4440
4441**Description**
4442
4443Backs up an RDB store using the backup file of the specified path. This API supports vector stores.
4444
4445**Since**: 10
4446
4447**Parameters**
4448
4449| Name| Description|
4450| -------- | -------- |
4451| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4452| databasePath | Pointer to the destination directory, in which the RDB store is backed up.|
4453
4454**Returns**
4455
4456Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4457
4458**RDB_OK** indicates that the operation is successful.
4459
4460**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4461
4462**See**
4463
4464[OH_Rdb_Store](_o_h___rdb___store.md).
4465
4466
4467### OH_Rdb_BeginTransaction()
4468
4469```
4470int OH_Rdb_BeginTransaction (OH_Rdb_Store *store)
4471```
4472
4473**Description**
4474
4475Begins the transaction before executing SQL statements.
4476
4477**Since**: 10
4478
4479**Parameters**
4480
4481| Name| Description|
4482| -------- | -------- |
4483| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4484
4485**Returns**
4486
4487Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4488
4489**RDB_OK** indicates that the operation is successful.
4490
4491**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4492
4493**See**
4494
4495[OH_Rdb_Store](_o_h___rdb___store.md).
4496
4497
4498### OH_Rdb_CloseStore()
4499
4500```
4501int OH_Rdb_CloseStore (OH_Rdb_Store *store)
4502```
4503
4504**Description**
4505
4506Closes an [OH_Rdb_Store](_o_h___rdb___store.md) object to reclaim the memory occupied.
4507
4508**Since**: 10
4509
4510**Parameters**
4511
4512| Name| Description|
4513| -------- | -------- |
4514| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance to close.|
4515
4516**Returns**
4517
4518Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4519
4520**RDB_OK** indicates that the operation is successful.
4521
4522**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4523
4524**See**
4525
4526[OH_Rdb_Store](_o_h___rdb___store.md).
4527
4528
4529### OH_Rdb_CloudSync()
4530
4531```
4532int OH_Rdb_CloudSync (OH_Rdb_Store *store, Rdb_SyncMode mode, const char *tables, int count, const Rdb_ProgressObserver *observer )
4533```
4534
4535**Description**
4536
4537Performs device-cloud sync.
4538
4539**Since**: 11
4540
4541**Parameters**
4542
4543| Name| Description|
4544| -------- | -------- |
4545| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4546| mode | Sync mode [Rdb_SyncMode](#rdb_syncmode).|
4547| tables | Pointer to the tables to sync.|
4548| count | Number of tables to sync. If the value is **0**, all tables in the RDB store are synced.|
4549| observer | [Rdb_ProgressObserver](_rdb___progress_observer.md) of the device-cloud sync progress.|
4550
4551**Returns**
4552
4553Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4554
4555**RDB_OK** indicates that the operation is successful.
4556
4557**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4558
4559**See**
4560
4561[OH_Rdb_Store](_o_h___rdb___store.md).
4562
4563
4564### OH_Rdb_Commit()
4565
4566```
4567int OH_Rdb_Commit (OH_Rdb_Store *store)
4568```
4569
4570**Description**
4571
4572Commits the executed SQL statements.
4573
4574**Since**: 10
4575
4576**Parameters**
4577
4578| Name| Description|
4579| -------- | -------- |
4580| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4581
4582**Returns**
4583
4584Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4585
4586**RDB_OK** indicates that the operation is successful.
4587
4588**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4589
4590**See**
4591
4592[OH_Rdb_Store](_o_h___rdb___store.md).
4593
4594
4595### OH_Rdb_CreatePredicates()
4596
4597```
4598OH_Predicates* OH_Rdb_CreatePredicates (const char *table)
4599```
4600
4601**Description**
4602
4603Creates an [OH_Predicates](_o_h___predicates.md) instance.
4604
4605**Since**: 10
4606
4607**Parameters**
4608
4609| Name| Description|
4610| -------- | -------- |
4611| table | Pointer to the name of the database table.|
4612
4613**Returns**
4614
4615Returns the pointer to the [OH_Predicates](_o_h___predicates.md) instance created if the operation is successful; returns null otherwise.
4616
4617**See**
4618
4619[OH_Predicates](_o_h___predicates.md).
4620
4621
4622### OH_Rdb_CreateValueObject()
4623
4624```
4625OH_VObject* OH_Rdb_CreateValueObject ()
4626```
4627
4628**Description**
4629
4630Creates an [OH_VObject](_o_h___v_object.md) instance.
4631
4632**Since**: 10
4633
4634**Returns**
4635
4636Returns the pointer to the [OH_VObject](_o_h___v_object.md) instance created if the operation is successful; returns null otherwise.
4637
4638**See**
4639
4640[OH_VObject](_o_h___v_object.md).
4641
4642
4643### OH_Rdb_CreateValuesBucket()
4644
4645```
4646OH_VBucket* OH_Rdb_CreateValuesBucket ()
4647```
4648
4649**Description**
4650
4651Creates an [OH_VBucket](_o_h___v_bucket.md) instance.
4652
4653**Since**: 10
4654
4655**Returns**
4656
4657Returns the pointer to the [OH_VBucket](_o_h___v_bucket.md) instance created if the operation is successful; returns null otherwise.
4658
4659**See**
4660
4661[OH_VBucket](_o_h___v_bucket.md).
4662
4663
4664### OH_Rdb_Delete()
4665
4666```
4667int OH_Rdb_Delete (OH_Rdb_Store *store, OH_Predicates *predicates )
4668```
4669
4670**Description**
4671
4672Deletes data from an RDB store based on specified conditions.
4673
4674**Since**: 10
4675
4676**Parameters**
4677
4678| Name| Description|
4679| -------- | -------- |
4680| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4681| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the deletion conditions.|
4682
4683**Returns**
4684
4685Returns the number of deleted rows if the operation is successful; returns a number less than <b>0</b> otherwise.
4686
4687**See**
4688
4689[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md).
4690
4691
4692### OH_Rdb_DeleteStore()
4693
4694```
4695int OH_Rdb_DeleteStore (const OH_Rdb_Config *config)
4696```
4697
4698**Description**
4699
4700Deletes an RDB store with the specified configuration.
4701
4702**Since**: 10
4703
4704**Parameters**
4705
4706| Name| Description|
4707| -------- | -------- |
4708| config | Pointer to the database configuration.|
4709
4710**Returns**
4711
4712Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4713
4714
4715### OH_Rdb_Execute()
4716
4717```
4718int OH_Rdb_Execute (OH_Rdb_Store *store, const char *sql )
4719```
4720
4721**Description**
4722
4723Executes an SQL statement that returns no value.
4724
4725**Since**: 10
4726
4727**Parameters**
4728
4729| Name| Description|
4730| -------- | -------- |
4731| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4732| sql | Pointer to the SQL statement to execute.|
4733
4734**Returns**
4735
4736Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4737
4738**RDB_OK** indicates that the operation is successful.
4739
4740**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
4741
4742**See**
4743
4744[OH_Rdb_Store](_o_h___rdb___store.md).
4745
4746
4747### OH_Rdb_ExecuteQuery()
4748
4749```
4750OH_Cursor* OH_Rdb_ExecuteQuery (OH_Rdb_Store *store, const char *sql )
4751```
4752
4753**Description**
4754
4755Queries data in the database using the specified SQL statement. This API supports vector stores.
4756
4757**Since**: 10
4758
4759**Parameters**
4760
4761| Name| Description|
4762| -------- | -------- |
4763| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4764| sql | Pointer to the SQL statement to execute.|
4765
4766**Returns**
4767
4768Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise.
4769
4770**See**
4771
4772[OH_Rdb_Store](_o_h___rdb___store.md).
4773
4774
4775### OH_Rdb_FindModifyTime()
4776
4777```
4778OH_Cursor* OH_Rdb_FindModifyTime (OH_Rdb_Store *store, const char *tableName, const char *columnName, OH_VObject *values )
4779```
4780
4781**Description**
4782
4783Obtains the last modification time of a table in an RDB store.
4784
4785**Since**: 11
4786
4787**Parameters**
4788
4789| Name| Description|
4790| -------- | -------- |
4791| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4792| tableName | Pointer to the target distributed database table.|
4793| columnName | Pointer to the column of the database table to query.|
4794| values | Pointer to the primary keys of the rows to query. If the database table has no primary key, **rowid** must be passed in through **columnName**. In this case, **values** specifies the row number of the database table to query.|
4795
4796**Returns**
4797
4798Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4799
4800**See**
4801
4802[OH_Rdb_Store](_o_h___rdb___store.md).
4803
4804
4805### OH_Rdb_GetOrOpen()
4806
4807```
4808OH_Rdb_Store* OH_Rdb_GetOrOpen (const OH_Rdb_Config *config, int *errCode )
4809```
4810
4811**Description**
4812
4813Obtains an [OH_Rdb_Store](_o_h___rdb___store.md) instance for RDB store operations.
4814
4815**Since**: 10
4816
4817**Parameters**
4818
4819| Name| Description|
4820| -------- | -------- |
4821| config | Pointer to the [OH_Rdb_Config](_o_h___rdb___config.md) instance, which specifies the database configuration.|
4822| errCode | Function execution status.|
4823
4824**Returns**
4825
4826Returns the pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance created if the operation is successful; returns null otherwise.
4827
4828**See**
4829
4830[OH_Rdb_Config](_o_h___rdb___config.md), [OH_Rdb_Store](_o_h___rdb___store.md).
4831
4832
4833### OH_Rdb_GetTableDetails()
4834
4835```
4836Rdb_TableDetails* OH_Rdb_GetTableDetails (Rdb_ProgressDetails *progress, int32_t version )
4837```
4838
4839**Description**
4840
4841Obtains the device-cloud sync statistics of a table.
4842
4843**Since**: 11
4844
4845**Parameters**
4846
4847| Name| Description|
4848| -------- | -------- |
4849| progress | Pointer to the **OH_ProgressDetails** instance.|
4850| version | Version of [Rdb_ProgressDetails](_rdb___progress_details.md).|
4851
4852**Returns**
4853
4854Returns a pointer to [Rdb_TableDetails](_rdb___table_details.md) if the operation is successful; returns null otherwise.
4855
4856**See**
4857
4858[Rdb_ProgressDetails](_rdb___progress_details.md)
4859
4860[Rdb_TableDetails](_rdb___table_details.md)
4861
4862
4863### OH_Rdb_GetVersion()
4864
4865```
4866int OH_Rdb_GetVersion (OH_Rdb_Store *store, int *version )
4867```
4868
4869**Description**
4870
4871Obtains the RDB store version.
4872
4873**Since**: 10
4874
4875**Parameters**
4876
4877| Name| Description|
4878| -------- | -------- |
4879| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4880| version |  Pointer to the version obtained.|
4881
4882**Returns**
4883
4884Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
4885
4886**See**
4887
4888[OH_Rdb_Store](_o_h___rdb___store.md).
4889
4890
4891### OH_Rdb_Insert()
4892
4893```
4894int OH_Rdb_Insert (OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBucket )
4895```
4896
4897**Description**
4898
4899Inserts a row of data into a table.
4900
4901**Since**: 10
4902
4903**Parameters**
4904
4905| Name| Description|
4906| -------- | -------- |
4907| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4908| table | Pointer to the target table.|
4909| valuesBucket | Pointer to the data [OH_VBucket](_o_h___v_bucket.md) to insert.|
4910
4911**Returns**
4912
4913Returns **rowID** if the operation is successful; returns a number less than **0** otherwise.
4914
4915**See**
4916
4917[OH_Rdb_Store](_o_h___rdb___store.md), [OH_VBucket](_o_h___v_bucket.md).
4918
4919### OH_Rdb_LockRow()
4920
4921```
4922int OH_Rdb_LockRow (OH_Rdb_Store *store, OH_Predicates *predicates )
4923```
4924
4925**Description**
4926
4927Locks data in an RDB store based on specified conditions. The locked data will be blocked from the device-cloud sync.
4928
4929**Since**: 12
4930
4931**Parameters**
4932
4933| Name| Description|
4934| -------- | -------- |
4935| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4936| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the lock conditions.|
4937
4938**Returns**
4939
4940Result of the lock operation.
4941
4942**See**
4943
4944[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md).
4945
4946### OH_Rdb_Query()
4947
4948```
4949OH_Cursor* OH_Rdb_Query (OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length )
4950```
4951
4952**Description**
4953
4954Queries data in an RDB store based on specified conditions.
4955
4956**Since**: 10
4957
4958**Parameters**
4959
4960| Name| Description|
4961| -------- | -------- |
4962| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4963| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the query conditions.|
4964| columnNames | Pointer to the columns to query. If this parameter is not specified, data of columns will be queried.|
4965| length | Length of **columnNames**. If <b>length</b> is greater than the length of <b>columnNames</b> array, out-of-bounds access occurs.|
4966
4967**Returns**
4968
4969Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise.
4970
4971**See**
4972
4973[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md), [OH_Cursor](_o_h___cursor.md).
4974
4975### OH_Rdb_QueryLockedRow()
4976
4977```
4978OH_Cursor *OH_Rdb_QueryLockedRow (OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length )
4979```
4980
4981**Description**
4982
4983Queries the locked data in an RDB store.
4984
4985**Since**: 12
4986
4987**Parameters**
4988
4989| Name| Description|
4990| -------- | -------- |
4991| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
4992| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the query conditions.|
4993| columnNames | Pointer to the columns to query. If this parameter is not specified, data of columns will be queried.|
4994| length | Length of **columnNames**. If <b>length</b> is greater than the length of <b>columnNames</b> array, out-of-bounds access occurs.|
4995
4996**Returns**
4997
4998Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise.
4999
5000**See**
5001
5002[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md), [OH_Cursor](_o_h___cursor.md).
5003
5004### OH_Rdb_Restore()
5005
5006```
5007int OH_Rdb_Restore (OH_Rdb_Store *store, const char *databasePath )
5008```
5009
5010**Description**
5011
5012Restores a database from a specified database backup file. This API supports vector stores.
5013
5014**Since**: 10
5015
5016**Parameters**
5017
5018| Name| Description|
5019| -------- | -------- |
5020| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5021| databasePath | Pointer to the destination directory in which the RDB store is backed up.|
5022
5023**Returns**
5024
5025Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5026
5027**RDB_OK** indicates that the operation is successful.
5028
5029**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5030
5031**See**
5032
5033[OH_Rdb_Store](_o_h___rdb___store.md).
5034
5035
5036### OH_Rdb_RollBack()
5037
5038```
5039int OH_Rdb_RollBack (OH_Rdb_Store *store)
5040```
5041
5042**Description**
5043
5044Rolls back the SQL statements executed.
5045
5046**Since**: 10
5047
5048**Parameters**
5049
5050| Name| Description|
5051| -------- | -------- |
5052| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5053
5054**Returns**
5055
5056Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5057
5058**RDB_OK** indicates that the operation is successful.
5059
5060**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5061
5062**See**
5063
5064[OH_Rdb_Store](_o_h___rdb___store.md).
5065
5066
5067### OH_Rdb_SetDistributedTables()
5068
5069```
5070int OH_Rdb_SetDistributedTables (OH_Rdb_Store *store, const char *tables[], uint32_t count, Rdb_DistributedType type, const Rdb_DistributedConfig * config )
5071```
5072
5073**Description**
5074
5075Sets distributed database tables.
5076
5077**Since**: 11
5078
5079**Parameters**
5080
5081| Name| Description|
5082| -------- | -------- |
5083| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5084| tables | Pointer to the names of the distributed tables to set.|
5085| count | Number of distributed database tables to set.|
5086| type | [Rdb_DistributedType](#rdb_distributedtype).|
5087| config | Configuration of the distributed mode. For details, see [Rdb_DistributedConfig](_rdb___distributed_config.md).|
5088
5089**Returns**
5090
5091Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5092
5093**RDB_OK** indicates that the operation is successful.
5094
5095**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5096
5097**See**
5098
5099[OH_Rdb_Store](_o_h___rdb___store.md).
5100
5101
5102### OH_Rdb_SetVersion()
5103
5104```
5105int OH_Rdb_SetVersion (OH_Rdb_Store *store, int version )
5106```
5107
5108**Description**
5109
5110Sets the RDB store version.
5111
5112**Since**: 10
5113
5114**Parameters**
5115
5116| Name| Description|
5117| -------- | -------- |
5118| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5119| version | Version to set.|
5120
5121**Returns**
5122
5123Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5124
5125**RDB_OK** indicates that the operation is successful.
5126
5127**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5128
5129**See**
5130
5131[OH_Rdb_Store](_o_h___rdb___store.md).
5132
5133
5134### OH_Rdb_Subscribe()
5135
5136```
5137int OH_Rdb_Subscribe (OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer )
5138```
5139
5140**Description**
5141
5142Registers an observer for an RDB store. When data in the RDB store changes, a callback will be invoked to return the data changes.
5143
5144**Since**: 11
5145
5146**Parameters**
5147
5148| Name| Description|
5149| -------- | -------- |
5150| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5151| type | Subscription type defined in [Rdb_SubscribeType](#rdb_subscribetype).|
5152| observer | Pointer to the [Rdb_DataObserver](_rdb___data_observer.md) instance.|
5153
5154**Returns**
5155
5156Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5157
5158**RDB_OK** indicates that the operation is successful.
5159
5160**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5161
5162**See**
5163
5164[OH_Rdb_Store](_o_h___rdb___store.md).
5165
5166[Rdb_DataObserver](_rdb___data_observer.md).
5167
5168
5169### OH_Rdb_SubscribeAutoSyncProgress()
5170
5171```
5172int OH_Rdb_SubscribeAutoSyncProgress (OH_Rdb_Store *store, const Rdb_ProgressObserver *observer )
5173```
5174
5175**Description**
5176
5177Subscribes to the auto sync progress of an RDB store. The registered callback will be invoked to return the auto sync progress. **RDB_OK** indicates that the operation is successful. <br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5178
5179**Since**: 11
5180
5181**Parameters**
5182
5183| Name| Description|
5184| -------- | -------- |
5185| store | Pointer to the target [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5186| observer | Pointer to the [Rdb_ProgressObserver](_rdb___progress_observer.md) instance, which invokes the callback to return the automatic sync progress.|
5187
5188**Returns**
5189
5190Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5191
5192**See**
5193
5194[OH_Rdb_Store](_o_h___rdb___store.md).
5195
5196[Rdb_ProgressObserver](_rdb___progress_observer.md).
5197
5198### OH_Rdb_UnlockRow()
5199
5200```
5201int OH_Rdb_UnlockRow (OH_Rdb_Store *store, OH_Predicates *predicates )
5202```
5203
5204**Description**
5205
5206Unlocks data in an RDB store based on the specified conditions.
5207
5208**Since**: 12
5209
5210**Parameters**
5211
5212| Name| Description|
5213| -------- | -------- |
5214| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5215| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the unlock conditions.|
5216
5217**Returns**
5218
5219Result of the unlock operation.
5220
5221**See**
5222
5223[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md).
5224
5225### OH_Rdb_Unsubscribe()
5226
5227```
5228int OH_Rdb_Unsubscribe (OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer )
5229```
5230
5231**Description**
5232
5233Unregisters the observer of the specified type.
5234
5235**Since**: 11
5236
5237**Parameters**
5238
5239| Name| Description|
5240| -------- | -------- |
5241| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5242| type | Subscription type defined in [Rdb_SubscribeType](#rdb_subscribetype).|
5243| observer | Pointer to the [Rdb_DataObserver](_rdb___data_observer.md) instance to unregister. If this parameter is **nullptr**, all observers of this type will be unregistered.|
5244
5245**Returns**
5246
5247Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5248
5249**RDB_OK** indicates that the operation is successful.
5250
5251**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5252
5253**See**
5254
5255[OH_Rdb_Store](_o_h___rdb___store.md).
5256
5257[Rdb_DataObserver](_rdb___data_observer.md).
5258
5259
5260### OH_Rdb_UnsubscribeAutoSyncProgress()
5261
5262```
5263int OH_Rdb_UnsubscribeAutoSyncProgress (OH_Rdb_Store *store, const Rdb_ProgressObserver *observer )
5264```
5265
5266**Description**
5267
5268Unsubscribes from the auto sync process of an RDB store.
5269
5270**Since**: 11
5271
5272**Parameters**
5273
5274| Name| Description|
5275| -------- | -------- |
5276| store | Pointer to the target [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5277| observer | Pointer to [Rdb_ProgressObserver](_rdb___progress_observer.md) to unregister. If the pointer is null, all callbacks for the auto sync process will be unregistered.|
5278
5279**Returns**
5280
5281Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5282
5283**RDB_OK** indicates that the operation is successful.
5284
5285**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.
5286
5287**See**
5288
5289[OH_Rdb_Store](_o_h___rdb___store.md).
5290
5291[Rdb_ProgressObserver](_rdb___progress_observer.md).
5292
5293
5294### OH_Rdb_Update()
5295
5296```
5297int OH_Rdb_Update (OH_Rdb_Store *store, OH_VBucket *valuesBucket, OH_Predicates *predicates )
5298```
5299
5300**Description**
5301
5302Updates data in an RDB store based on specified conditions.
5303
5304**Since**: 10
5305
5306**Parameters**
5307
5308| Name| Description|
5309| -------- | -------- |
5310| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
5311| valuesBucket | Pointer to the new [OH_VBucket](_o_h___v_bucket.md) to be inserted to the table.|
5312| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, specifying the update conditions.|
5313
5314**Returns**
5315
5316Returns the number of updated rows if the operation is successful; returns a number less than **0** otherwise.
5317
5318**See**
5319
5320[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Bucket](_o_h___v_bucket.md), [OH_Predicates](_o_h___predicates.md).
5321
5322
5323### OH_VBucket_PutAsset()
5324
5325```
5326int OH_VBucket_PutAsset (OH_VBucket *bucket, const char *field, OH_Asset *value )
5327```
5328
5329**Description**
5330
5331Puts an **OH_Asset** object into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
5332
5333**Since**: 11
5334
5335**Parameters**
5336
5337| Name| Description|
5338| -------- | -------- |
5339| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
5340| field | Pointer to the column name in the database table.|
5341| value | Pointer to the data to put.|
5342
5343**Returns**
5344
5345Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5346
5347**See**
5348
5349[OH_VBucket](_o_h___v_bucket.md).
5350
5351
5352### OH_VBucket_PutAssets()
5353
5354```
5355int OH_VBucket_PutAssets (OH_VBucket *bucket, const char *field, OH_Asset **value, int count )
5356```
5357
5358**Description**
5359
5360Puts an array of **OH_Asset** objects into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.
5361
5362**Since**: 11
5363
5364**Parameters**
5365
5366| Name| Description|
5367| -------- | -------- |
5368| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
5369| field | Pointer to the column name in the database table.|
5370| value | Double pointer to the data to put.|
5371| count | Number of elements in the **OH_Asset** array.|
5372
5373**Returns**
5374
5375Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5376
5377**See**
5378
5379[OH_VBucket](_o_h___v_bucket.md).
5380
5381## Variable Description
5382
5383
5384### andOperate
5385
5386```
5387OH_Predicates *(*andOperate) (OH_Predicates *predicates)
5388```
5389
5390**Description**
5391
5392Pointer to the function used to add the AND operator to the predicates.
5393
5394This method is equivalent to **AND** in SQL statements.
5395
5396**Since**: 10
5397
5398**Parameters**
5399
5400| Name| Description|
5401| -------- | -------- |
5402| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5403
5404**Returns**
5405
5406Returns the predicates with the AND operator.
5407
5408**See**
5409
5410[OH_Predicates](_o_h___predicates.md).
5411
5412
5413### area
5414
5415```
5416int OH_Rdb_Config::area
5417```
5418
5419**Description**
5420
5421Pointer to the function used to set [Rdb_SecurityArea](#rdb_securityarea).
5422
5423**Since**: 11
5424
5425
5426### beginWrap
5427
5428```
5429OH_Predicates *(*beginWrap) (OH_Predicates *predicates)
5430```
5431
5432**Description**
5433
5434Pointer to the function used to add a left parenthesis to the predicates.
5435
5436This method is equivalent to "(" in SQL statements.
5437
5438**Since**: 10
5439
5440**Parameters**
5441
5442| Name| Description|
5443| -------- | -------- |
5444| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5445
5446**Returns**
5447
5448Returns the predicates with a left parenthesis.
5449
5450**See**
5451
5452[OH_Predicates](_o_h___predicates.md).
5453
5454
5455### between
5456
5457```
5458OH_Predicates *(*between) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
5459```
5460
5461**Description**
5462
5463Pointer to the function used to create a predicates object to search for the field values that are within the specified range.
5464
5465This method is equivalent to **BETWEEN** in SQL statements.
5466
5467**Since**: 10
5468
5469**Parameters**
5470
5471| Name| Description|
5472| -------- | -------- |
5473| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5474| field | Pointer to the column name in the database table.|
5475| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
5476
5477**Returns**
5478
5479Returns the predicates created.
5480
5481**See**
5482
5483[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
5484
5485
5486### briefObserver
5487
5488```
5489Rdb_BriefObserver Rdb_SubscribeCallback::briefObserver
5490```
5491
5492**Description**
5493
5494Callback used to return the device-cloud data change event.
5495
5496
5497### bundleName
5498
5499```
5500const char* OH_Rdb_Config::bundleName
5501```
5502
5503**Description**
5504
5505Bundle name.
5506
5507
5508### callback [1/2]
5509
5510```
5511Rdb_SubscribeCallback Rdb_DataObserver::callback
5512```
5513
5514**Description**
5515
5516Callback of the data observer.
5517
5518
5519### callback [2/2]
5520
5521```
5522Rdb_ProgressCallback Rdb_ProgressObserver::callback
5523```
5524
5525**Description**
5526
5527Callback used to return the device-cloud sync progress.
5528
5529
5530### capability
5531
5532```
5533uint16_t OH_VBucket::capability
5534```
5535
5536**Description**
5537
5538Number of the KV pairs in the struct.
5539
5540
5541### ChangeType
5542
5543```
5544int Rdb_ChangeInfo::ChangeType
5545```
5546
5547**Description**
5548
5549Type of the data changed, which can be data or asset.
5550
5551
5552### clear [1/2]
5553
5554```
5555OH_Predicates *(*clear) (OH_Predicates *predicates)
5556```
5557
5558**Description**
5559
5560Pointer to the function used to clear a predicates instance.
5561
5562**Since**: 10
5563
5564**Parameters**
5565
5566| Name| Description|
5567| -------- | -------- |
5568| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5569
5570**Returns**
5571
5572Cleared predicates.
5573
5574**See**
5575
5576[OH_Predicates](_o_h___predicates.md).
5577
5578
5579### clear [2/2]
5580
5581```
5582int(*clear) (OH_VBucket *bucket)
5583```
5584
5585**Description**
5586
5587Pointer to the function used to clear an [OH_VBucket](_o_h___v_bucket.md) object.
5588
5589**Since**: 10
5590
5591**Parameters**
5592
5593| Name| Description|
5594| -------- | -------- |
5595| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
5596
5597**Returns**
5598
5599Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5600
5601**See**
5602
5603[OH_VBucket](_o_h___v_bucket.md).
5604
5605
5606### code
5607
5608```
5609int Rdb_ProgressDetails::code
5610```
5611
5612**Description**
5613
5614Device-cloud sync state.
5615
5616
5617### context [1/2]
5618
5619```
5620void* Rdb_DataObserver::context
5621```
5622
5623**Description**
5624
5625Context of the data observer.
5626
5627
5628### context [2/2]
5629
5630```
5631void* Rdb_ProgressObserver::context
5632```
5633
5634**Description**
5635
5636Context of the device-cloud sync progress observer.
5637
5638
5639### count
5640
5641```
5642int Rdb_KeyInfo::count
5643```
5644
5645**Description**
5646
5647Number of the changed primary keys or row numbers.
5648
5649
5650### dataBaseDir
5651
5652```
5653const char* OH_Rdb_Config::dataBaseDir
5654```
5655
5656**Description**
5657
5658Path of the database file.
5659
5660
5661### deleted
5662
5663```
5664Rdb_KeyInfo Rdb_ChangeInfo::deleted
5665```
5666
5667**Description**
5668
5669Location where data is deleted. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, the value is the row number of the deleted data.
5670
5671
5672### destroy [1/4]
5673
5674```
5675int(*destroy) (OH_Cursor *cursor)
5676```
5677
5678**Description**
5679
5680Pointer to the function used to destroy a result set.
5681
5682**Since**: 10
5683
5684**Parameters**
5685
5686| Name| Description|
5687| -------- | -------- |
5688| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
5689
5690**Returns**
5691
5692Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5693
5694**See**
5695
5696[OH_Cursor](_o_h___cursor.md).
5697
5698
5699### destroy [2/4]
5700
5701```
5702int(*destroy) (OH_Predicates *predicates)
5703```
5704
5705**Description**
5706
5707Pointer to the function used to destroy an [OH_Predicates](_o_h___predicates.md) object to reclaim the memory occupied.
5708
5709**Since**: 10
5710
5711**Parameters**
5712
5713| Name| Description|
5714| -------- | -------- |
5715| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5716
5717**Returns**
5718
5719Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5720
5721**See**
5722
5723[OH_Predicates](_o_h___predicates.md).
5724
5725
5726### destroy [3/4]
5727
5728```
5729int(*destroy) (OH_VBucket *bucket)
5730```
5731
5732**Description**
5733
5734Pointer to the function used to destroy an [OH_VBucket](_o_h___v_bucket.md) object to reclaim the memory occupied.
5735
5736**Since**: 10
5737
5738**Parameters**
5739
5740| Name| Description|
5741| -------- | -------- |
5742| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
5743
5744**Returns**
5745
5746Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5747
5748**See**
5749
5750[OH_VBucket](_o_h___v_bucket.md).
5751
5752
5753### destroy [4/4]
5754
5755```
5756int(*destroy) (OH_VObject *valueObject)
5757```
5758
5759**Description**
5760
5761Pointer to the function used to destroy an [OH_VObject](_o_h___v_object.md) object to reclaim the memory occupied.
5762
5763**Since**: 10
5764
5765**Parameters**
5766
5767| Name| Description|
5768| -------- | -------- |
5769| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
5770
5771**Returns**
5772
5773Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5774
5775**See**
5776
5777[OH_VObject](_o_h___v_object.md).
5778
5779
5780### detailsObserver
5781
5782```
5783Rdb_DetailsObserver Rdb_SubscribeCallback::detailsObserver
5784```
5785
5786**Description**
5787
5788Callback used to return the details about the device-cloud data change.
5789
5790
5791### distinct
5792
5793```
5794OH_Predicates *(*distinct) (OH_Predicates *predicates)
5795```
5796
5797**Description**
5798
5799Pointer to the function used to create a predicates object to filter out duplicate records.
5800
5801This method is equivalent to **DISTINCT** in SQL statements.
5802
5803**Since**: 10
5804
5805**Parameters**
5806
5807| Name| Description|
5808| -------- | -------- |
5809| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5810
5811**Returns**
5812
5813Returns the predicates created.
5814
5815**See**
5816
5817[OH_Predicates](_o_h___predicates.md).
5818
5819
5820### download
5821
5822```
5823Rdb_Statistic Rdb_TableDetails::download
5824```
5825
5826**Description**
5827
5828Statistics of the device-cloud download tasks.
5829
5830
5831### endWrap
5832
5833```
5834OH_Predicates *(*endWrap) (OH_Predicates *predicates)
5835```
5836
5837**Description**
5838
5839Pointer to the function used to add a right parenthesis to the predicates.
5840
5841This method is equivalent to ")" in SQL statements.
5842
5843**Since**: 10
5844
5845**Parameters**
5846
5847| Name| Description|
5848| -------- | -------- |
5849| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5850
5851**Returns**
5852
5853Returns the predicates object with a right parenthesis.
5854
5855**See**
5856
5857[OH_Predicates](_o_h___predicates.md).
5858
5859
5860### equalTo
5861
5862```
5863OH_Predicates *(*equalTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
5864```
5865
5866**Description**
5867
5868Pointer to the function used to create a predicates object to search for the field values that are equal to the specified value.
5869
5870This method is equivalent to "=" in SQL statements.
5871
5872**Since**: 10
5873
5874**Parameters**
5875
5876| Name| Description|
5877| -------- | -------- |
5878| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
5879| field | Pointer to the column name in the database table.|
5880| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
5881
5882**Returns**
5883
5884Returns the predicates created.
5885
5886**See**
5887
5888[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
5889
5890
5891### failed
5892
5893```
5894int Rdb_Statistic::failed
5895```
5896
5897**Description**
5898
5899Number of rows that failed to be synced between the device and cloud in the database table.
5900
5901
5902### getAsset
5903
5904```
5905int(*getAsset) (OH_Cursor *cursor, int32_t columnIndex, Data_Asset *value)
5906```
5907
5908**Description**
5909
5910Pointer to the function used to obtain the value of the asset type based on the specified column and the current row.
5911
5912**Since**: 11
5913
5914**Parameters**
5915
5916| Name| Description|
5917| -------- | -------- |
5918| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
5919| columnIndex | Index of the column, which starts from **0**.|
5920| value | Pointer to the value obtained.|
5921
5922**Returns**
5923
5924Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5925
5926**See**
5927
5928[OH_Cursor](_o_h___cursor.md).
5929
5930
5931### getAssets
5932
5933```
5934int(*getAssets) (OH_Cursor *cursor, int32_t columnIndex, Data_Asset **value, uint32_t length)
5935```
5936
5937**Description**
5938
5939Pointer to the function used to obtain the values in the form of an asset array based on the specified column and the current row.
5940
5941**Since**: 11
5942
5943**Parameters**
5944
5945| Name| Description|
5946| -------- | -------- |
5947| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
5948| columnIndex | Index of the column, which starts from **0**.|
5949| value | Double pointer to the value obtained.|
5950| length | Length of the buffer, which is a variable of the uint32_t type passed in. After the API is executed, the variable is updated to the length of the returned asset array.|
5951
5952**Returns**
5953
5954Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5955
5956**See**
5957
5958[OH_Cursor](_o_h___cursor.md).
5959
5960
5961### getBlob
5962
5963```
5964int(*getBlob) (OH_Cursor *cursor, int32_t columnIndex, unsigned char *value, int length)
5965```
5966
5967**Description**
5968
5969Pointer to the function used to obtain the values in the form of a byte array based on the specified column and the current row.
5970
5971**Since**: 10
5972
5973**Parameters**
5974
5975| Name| Description|
5976| -------- | -------- |
5977| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
5978| columnIndex | Index of the column, which starts from **0**.|
5979| value | Pointer to the values in the form of a byte array obtained.|
5980| length | Length of **value**, obtained by using **getSize**.|
5981
5982**Returns**
5983
5984Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
5985
5986**See**
5987
5988[OH_Cursor](_o_h___cursor.md).
5989
5990
5991### getColumnCount
5992
5993```
5994int(*getColumnCount) (OH_Cursor *cursor, int *count)
5995```
5996
5997**Description**
5998
5999Pointer to the function used to obtain the number of columns in the result set.
6000
6001**Since**: 10
6002
6003**Parameters**
6004
6005| Name| Description|
6006| -------- | -------- |
6007| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6008| count | Pointer to the number of columns in the result set obtained.|
6009
6010**Returns**
6011
6012Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6013
6014**See**
6015
6016[OH_Cursor](_o_h___cursor.md).
6017
6018
6019### getColumnIndex
6020
6021```
6022int(*getColumnIndex) (OH_Cursor *cursor, const char *name, int *columnIndex)
6023```
6024
6025**Description**
6026
6027Pointer to the function used to obtain the column index based on the specified column name.
6028
6029**Since**: 10
6030
6031**Parameters**
6032
6033| Name| Description|
6034| -------- | -------- |
6035| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6036| name | Pointer to the column name in the result set.|
6037| columnIndex | Pointer to the column index obtained.|
6038
6039**Returns**
6040
6041Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6042
6043**See**
6044
6045[OH_Cursor](_o_h___cursor.md).
6046
6047
6048### getColumnName
6049
6050```
6051int(*getColumnName) (OH_Cursor *cursor, int32_t columnIndex, char *name, int length)
6052```
6053
6054**Description**
6055
6056Pointer to the function used to obtain the column name based on the specified column index.
6057
6058**Since**: 10
6059
6060**Parameters**
6061
6062| Name| Description|
6063| -------- | -------- |
6064| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6065| columnIndex | Index of the column, which starts from **0**.|
6066| name | Pointer to the column name obtained.|
6067| length | Total length of the column name obtained, including the terminator.|
6068
6069**Returns**
6070
6071Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6072
6073**See**
6074
6075[OH_Cursor](_o_h___cursor.md).
6076
6077
6078### getColumnType
6079
6080```
6081int(*getColumnType) (OH_Cursor *cursor, int32_t columnIndex, OH_ColumnType *columnType)
6082```
6083
6084**Description**
6085
6086Pointer to the function used to obtain the column type based on the specified column index.
6087
6088**Since**: 10
6089
6090**Parameters**
6091
6092| Name| Description|
6093| -------- | -------- |
6094| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6095| columnIndex | Index of the column, which starts from **0**.|
6096| columnType | Pointer to the [OH_ColumnType](#oh_columntype) obtained.|
6097
6098**Returns**
6099
6100Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6101
6102**See**
6103
6104[OH_Cursor](_o_h___cursor.md), [OH_ColumnType](#oh_columntype).
6105
6106
6107### getInt64
6108
6109```
6110int(*getInt64) (OH_Cursor *cursor, int32_t columnIndex, int64_t *value)
6111```
6112
6113**Description**
6114
6115Pointer to the function used to obtain the value of the int64_t type based on the specified column and the current row.
6116
6117**Since**: 10
6118
6119**Parameters**
6120
6121| Name| Description|
6122| -------- | -------- |
6123| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6124| columnIndex | Index of the column, which starts from **0**.|
6125| value | Pointer to the value obtained.|
6126
6127**Returns**
6128
6129Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6130
6131**See**
6132
6133[OH_Cursor](_o_h___cursor.md).
6134
6135
6136### getReal
6137
6138```
6139int(*getReal) (OH_Cursor *cursor, int32_t columnIndex, double *value)
6140```
6141
6142**Description**
6143
6144Pointer to the function used to obtain the value of the double type based on the specified column and the current row.
6145
6146**Since**: 10
6147
6148**Parameters**
6149
6150| Name| Description|
6151| -------- | -------- |
6152| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6153| columnIndex | Index of the column, which starts from **0**.|
6154| value | Pointer to the value obtained.|
6155
6156**Returns**
6157
6158Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6159
6160**See**
6161
6162[OH_Cursor](_o_h___cursor.md).
6163
6164
6165### getRowCount
6166
6167```
6168int(*getRowCount) (OH_Cursor *cursor, int *count)
6169```
6170
6171**Description**
6172
6173Pointer to the function used to obtain the number of rows in the result set.
6174
6175**Since**: 10
6176
6177**Parameters**
6178
6179| Name| Description|
6180| -------- | -------- |
6181| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6182| count | Pointer to the number of columns in the result set obtained.|
6183
6184**Returns**
6185
6186Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6187
6188**See**
6189
6190[OH_Cursor](_o_h___cursor.md).
6191
6192
6193### getSize
6194
6195```
6196int(*getSize) (OH_Cursor *cursor, int32_t columnIndex, size_t *size)
6197```
6198
6199**Description**
6200
6201Pointer to the function used to obtain information about the memory required when the column data type in the result set is **BLOB** or **TEXT**.
6202
6203**Since**: 10
6204
6205**Parameters**
6206
6207| Name| Description|
6208| -------- | -------- |
6209| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6210| columnIndex | Index of the column, which starts from **0**.|
6211| size | Pointer to the memory size obtained.|
6212
6213**Returns**
6214
6215Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6216
6217**See**
6218
6219[OH_Cursor](_o_h___cursor.md).
6220
6221
6222### getText
6223
6224```
6225int(*getText) (OH_Cursor *cursor, int32_t columnIndex, char *value, int length)
6226```
6227
6228**Description**
6229
6230Pointer to the function used to obtain the value of the string type based on the specified column and the current row.
6231
6232**Since**: 10
6233
6234**Parameters**
6235
6236| Name| Description|
6237| -------- | -------- |
6238| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6239| columnIndex | Index of the column, which starts from **0**.|
6240| value | Pointer to the value of the string type obtained.|
6241| length | Length of **value**, obtained by using **getSize**.|
6242
6243**Returns**
6244
6245Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6246
6247**See**
6248
6249[OH_Cursor](_o_h___cursor.md).
6250
6251
6252### goToNextRow
6253
6254```
6255int(*goToNextRow) (OH_Cursor *cursor)
6256```
6257
6258**Description**
6259
6260Pointer to the function used to go to the next row of the result set.
6261
6262**Since**: 10
6263
6264**Parameters**
6265
6266| Name| Description|
6267| -------- | -------- |
6268| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6269
6270**Returns**
6271
6272Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6273
6274**See**
6275
6276[OH_Cursor](_o_h___cursor.md).
6277
6278
6279### greaterThan
6280
6281```
6282OH_Predicates *(*greaterThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6283```
6284
6285**Description**
6286
6287Pointer to the function used to create a predicates object to search for the field values that are greater than the specified value.
6288
6289This method is equivalent to "&gt;" in SQL statements.
6290
6291**Since**: 10
6292
6293**Parameters**
6294
6295| Name| Description|
6296| -------- | -------- |
6297| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6298| field | Pointer to the column name in the database table.|
6299| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6300
6301**Returns**
6302
6303Returns the predicates created.
6304
6305**See**
6306
6307[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6308
6309
6310### greaterThanOrEqualTo
6311
6312```
6313OH_Predicates *(*greaterThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6314```
6315
6316**Description**
6317
6318Pointer to the function used to create a predicates object to search for the field values that are greater than or equal to the specified value.
6319
6320This method is equivalent to "&gt;=" in SQL statements.
6321
6322**Since**: 10
6323
6324**Parameters**
6325
6326| Name| Description|
6327| -------- | -------- |
6328| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6329| field | Pointer to the column name in the database table.|
6330| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6331
6332**Returns**
6333
6334Returns the predicates created.
6335
6336**See**
6337
6338[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6339
6340
6341### groupBy
6342
6343```
6344OH_Predicates *(*groupBy) (OH_Predicates *predicates, char const *const *fields, int length)
6345```
6346
6347**Description**
6348
6349Pointer to the function used to create a predicates object to group the results by the specified columns.
6350
6351This method is equivalent to **GROUP BY** in SQL statements.
6352
6353**Since**: 10
6354
6355**Parameters**
6356
6357| Name| Description|
6358| -------- | -------- |
6359| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6360| fields | Pointer to the names of the columns by which the records are grouped.|
6361| length | Length of **fields**.|
6362
6363**Returns**
6364
6365Returns the predicates created.
6366
6367**See**
6368
6369[OH_Predicates](_o_h___predicates.md).
6370
6371
6372### id [1/5]
6373
6374```
6375int64_t OH_Cursor::id
6376```
6377
6378**Description**
6379
6380Unique identifier of the **OH_Cursor** struct.
6381
6382
6383### id [2/5]
6384
6385```
6386int64_t OH_Predicates::id
6387```
6388
6389**Description**
6390
6391Unique identifier of the **OH_Predicates** struct.
6392
6393
6394### id [3/5]
6395
6396```
6397int64_t OH_VObject::id
6398```
6399
6400**Description**
6401
6402Unique identifier of the **OH_VObject** struct.
6403
6404
6405### id [4/5]
6406
6407```
6408int64_t OH_VBucket::id
6409```
6410
6411**Description**
6412
6413Unique identifier of the **OH_VBucket** struct.
6414
6415
6416### id [5/5]
6417
6418```
6419int64_t OH_Rdb_Store::id
6420```
6421
6422**Description**
6423
6424Unique identifier of the **OH_Rdb_Store** struct.
6425
6426
6427### in
6428
6429```
6430OH_Predicates *(*in) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6431```
6432
6433**Description**
6434
6435Pointer to the function used to create a predicates object to search for the field values that are within the specified range.
6436
6437This method is equivalent to **IN** in SQL statements.
6438
6439**Since**: 10
6440
6441**Parameters**
6442
6443| Name| Description|
6444| -------- | -------- |
6445| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6446| field | Pointer to the column name in the database table.|
6447| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6448
6449**Returns**
6450
6451Returns the predicates created.
6452
6453**See**
6454
6455[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6456
6457
6458### inserted
6459
6460```
6461Rdb_KeyInfo Rdb_ChangeInfo::inserted
6462```
6463
6464**Description**
6465
6466Location where data is inserted. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, the value is the row number of the inserted data.
6467
6468
6469### integer
6470
6471```
6472uint64_t Rdb_KeyInfo::Rdb_KeyData::integer
6473```
6474
6475**Description**
6476
6477Data of the uint64_t type.
6478
6479
6480### isAutoSync
6481
6482```
6483bool Rdb_DistributedConfig::isAutoSync
6484```
6485
6486**Description**
6487
6488Whether the table supports auto sync.
6489
6490
6491### isEncrypt
6492
6493```
6494bool OH_Rdb_Config::isEncrypt
6495```
6496
6497**Description**
6498
6499Whether to encrypt the RDB store.
6500
6501
6502### isNotNull
6503
6504```
6505OH_Predicates *(*isNotNull) (OH_Predicates *predicates, const char *field)
6506```
6507
6508**Description**
6509
6510Pointer to the function used to create a predicates object to search for the field values that are not null.
6511
6512This method is equivalent to **IS NOT NULL** in SQL statements.
6513
6514**Since**: 10
6515
6516**Parameters**
6517
6518| Name| Description|
6519| -------- | -------- |
6520| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6521| field | Pointer to the column name in the database table.|
6522
6523**Returns**
6524
6525Returns the predicates created.
6526
6527**See**
6528
6529[OH_Predicates](_o_h___predicates.md).
6530
6531
6532### isNull [1/2]
6533
6534```
6535int(*isNull) (OH_Cursor *cursor, int32_t columnIndex, bool *isNull)
6536```
6537
6538**Description**
6539
6540Pointer to the function used to check whether the value in the specified column is null.
6541
6542**Since**: 10
6543
6544**Parameters**
6545
6546| Name| Description|
6547| -------- | -------- |
6548| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance.|
6549| columnIndex | Index of the column, which starts from **0**.|
6550| isNull | Pointer to the value returned. The value **true** means the value is null; the value **false** means the opposite.|
6551
6552**Returns**
6553
6554Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6555
6556**See**
6557
6558[OH_Cursor](_o_h___cursor.md).
6559
6560
6561### isNull [2/2]
6562
6563```
6564OH_Predicates *(*isNull) (OH_Predicates *predicates, const char *field)
6565```
6566
6567**Description**
6568
6569Pointer to the function used to create a predicates object to search for the field values that are null.
6570
6571This method is equivalent to **IS NULL** in SQL statements.
6572
6573**Since**: 10
6574
6575**Parameters**
6576
6577| Name| Description|
6578| -------- | -------- |
6579| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6580| field | Pointer to the column name in the database table.|
6581
6582**Returns**
6583
6584Returns the predicates created.
6585
6586**See**
6587
6588[OH_Predicates](_o_h___predicates.md).
6589
6590
6591### lessThan
6592
6593```
6594OH_Predicates *(*lessThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6595```
6596
6597**Description**
6598
6599Pointer to the function used to create a predicates object to search for the records that are less than the given value in the specified field.
6600
6601This method is equivalent to "&lt;" in SQL statements.
6602
6603**Since**: 10
6604
6605**Parameters**
6606
6607| Name| Description|
6608| -------- | -------- |
6609| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6610| field | Pointer to the column name in the database table.|
6611| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6612
6613**Returns**
6614
6615Returns the predicates created.
6616
6617**See**
6618
6619[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6620
6621
6622### lessThanOrEqualTo
6623
6624```
6625OH_Predicates *(*lessThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6626```
6627
6628**Description**
6629
6630Pointer to the function used to create a predicates object to search for the records that are less than or equal to the specified **valueObject** in the specified field.
6631
6632This method is equivalent to "&lt;=" in SQL statements.
6633
6634**Since**: 10
6635
6636**Parameters**
6637
6638| Name| Description|
6639| -------- | -------- |
6640| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6641| field | Pointer to the column name in the database table.|
6642| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6643
6644**Returns**
6645
6646Returns the predicates created.
6647
6648**See**
6649
6650[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6651
6652
6653### like
6654
6655```
6656OH_Predicates *(*like) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6657```
6658
6659**Description**
6660
6661Pointer to the function used to create a predicates object to search for the field values that are similar to the specified string.
6662
6663This method is equivalent to **LIKE** in SQL statements.
6664
6665**Since**: 10
6666
6667**Parameters**
6668
6669| Name| Description|
6670| -------- | -------- |
6671| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6672| field | Pointer to the column name in the database table.|
6673| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6674
6675**Returns**
6676
6677Returns the predicates created.
6678
6679**See**
6680
6681[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6682
6683
6684### limit
6685
6686```
6687OH_Predicates *(*limit) (OH_Predicates *predicates, unsigned int value)
6688```
6689
6690**Description**
6691
6692Pointer to the function used to create a predicates object to specify the maximum number of records.
6693
6694This method is equivalent to **LIMIT** in SQL statements.
6695
6696**Since**: 10
6697
6698**Parameters**
6699
6700| Name| Description|
6701| -------- | -------- |
6702| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6703| value | Maximum number of data records.|
6704
6705**Returns**
6706
6707Returns the predicates created.
6708
6709**See**
6710
6711[OH_Predicates](_o_h___predicates.md).
6712
6713
6714### moduleName
6715
6716```
6717const char* OH_Rdb_Config::moduleName
6718```
6719
6720**Description**
6721
6722Module name.
6723
6724
6725### notBetween
6726
6727```
6728OH_Predicates *(*notBetween) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6729```
6730
6731**Description**
6732
6733Pointer to the function used to create a predicates object to search for the field values that are out of the specified range.
6734
6735This method is equivalent to **NOT BETWEEN** in SQL statements.
6736
6737**Since**: 10
6738
6739**Parameters**
6740
6741| Name| Description|
6742| -------- | -------- |
6743| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6744| field | Pointer to the column name in the database table.|
6745| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6746
6747**Returns**
6748
6749Returns the predicates created.
6750
6751**See**
6752
6753[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6754
6755
6756### notEqualTo
6757
6758```
6759OH_Predicates *(*notEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6760```
6761
6762**Description**
6763
6764Pointer to the function used to create a predicates object to search for the field values that are not equal to the specified value.
6765
6766This method is equivalent to "!=" in SQL statements.
6767
6768**Since**: 10
6769
6770**Parameters**
6771
6772| Name| Description|
6773| -------- | -------- |
6774| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6775| field | Pointer to the column name in the database table.|
6776| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6777
6778**Returns**
6779
6780Returns the predicates created.
6781
6782**See**
6783
6784[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6785
6786
6787### notIn
6788
6789```
6790OH_Predicates *(*notIn) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject)
6791```
6792
6793**Description**
6794
6795Pointer to the function used to create a predicates object to search for the field values that are out of the specified range.
6796
6797This method is equivalent to **NOT IN** in SQL statements.
6798
6799**Since**: 10
6800
6801**Parameters**
6802
6803| Name| Description|
6804| -------- | -------- |
6805| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6806| field | Pointer to the column name in the database table.|
6807| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values.|
6808
6809**Returns**
6810
6811Returns the predicates created.
6812
6813**See**
6814
6815[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md).
6816
6817
6818### offset
6819
6820```
6821OH_Predicates *(*offset) (OH_Predicates *predicates, unsigned int rowOffset)
6822```
6823
6824**Description**
6825
6826Pointer to the function used to create a predicates object to specify the start position of the query result.
6827
6828This method is equivalent to **OFFSET** in SQL statements.
6829
6830**Since**: 10
6831
6832**Parameters**
6833
6834| Name| Description|
6835| -------- | -------- |
6836| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6837| rowOffset | Start position of the returned result. The value is a positive integer.|
6838
6839**Returns**
6840
6841Returns the predicates created.
6842
6843**See**
6844
6845[OH_Predicates](_o_h___predicates.md).
6846
6847
6848### orderBy
6849
6850```
6851OH_Predicates *(*orderBy) (OH_Predicates *predicates, const char *field, OH_OrderType type)
6852```
6853
6854**Description**
6855
6856Pointer to the function used to create a predicates object to sort the values in the specified column in ascending or descending order.
6857
6858This method is equivalent to **ORDER BY** in SQL statements.
6859
6860**Since**: 10
6861
6862**Parameters**
6863
6864| Name| Description|
6865| -------- | -------- |
6866| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6867| field | Pointer to the column name in the database table.|
6868| type | Sorting type [OH_OrderType](#oh_ordertype).|
6869
6870**Returns**
6871
6872Returns the predicates created.
6873
6874**See**
6875
6876[OH_Predicates](_o_h___predicates.md), [OH_OrderType](#oh_ordertype).
6877
6878
6879### orOperate
6880
6881```
6882OH_Predicates *(*orOperate) (OH_Predicates *predicates)
6883```
6884
6885**Description**
6886
6887Pointer to the function used to add the OR operator to the predicates.
6888
6889This method is equivalent to **OR** in SQL statements.
6890
6891**Since**: 10
6892
6893**Parameters**
6894
6895| Name| Description|
6896| -------- | -------- |
6897| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance.|
6898
6899**Returns**
6900
6901Returns the predicates with the OR operator.
6902
6903**See**
6904
6905[OH_Predicates](_o_h___predicates.md).
6906
6907
6908### putBlob
6909
6910```
6911int(*putBlob) (OH_VBucket *bucket, const char *field, const uint8_t *value, uint32_t size)
6912```
6913
6914**Description**
6915
6916Pointer to the function used to put a const uint8_t value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
6917
6918**Since**: 10
6919
6920**Parameters**
6921
6922| Name| Description|
6923| -------- | -------- |
6924| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
6925| field | Pointer to the column name in the database table.|
6926| value | Pointer to the value to put.|
6927| size | Length of the value.|
6928
6929**Returns**
6930
6931Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6932
6933**See**
6934
6935[OH_VBucket](_o_h___v_bucket.md).
6936
6937
6938### putDouble
6939
6940```
6941int(*putDouble) (OH_VObject *valueObject, double *value, uint32_t count)
6942```
6943
6944**Description**
6945
6946Pointer 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.
6947
6948**Since**: 10
6949
6950**Parameters**
6951
6952| Name| Description|
6953| -------- | -------- |
6954| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
6955| value | Pointer to the data to covert.|
6956| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
6957
6958**Returns**
6959
6960Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6961
6962**See**
6963
6964[OH_VObject](_o_h___v_object.md).
6965
6966
6967### putInt64 [1/2]
6968
6969```
6970int(*putInt64) (OH_VBucket *bucket, const char *field, int64_t value)
6971```
6972
6973**Description**
6974
6975Pointer to the function used to put an int64_t value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
6976
6977**Since**: 10
6978
6979**Parameters**
6980
6981| Name| Description|
6982| -------- | -------- |
6983| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
6984| field | Pointer to the column name in the database table.|
6985| value | Pointer to the value to put.|
6986
6987**Returns**
6988
6989Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
6990
6991**See**
6992
6993[OH_VBucket](_o_h___v_bucket.md).
6994
6995
6996### putInt64 [2/2]
6997
6998```
6999int(*putInt64) (OH_VObject *valueObject, int64_t *value, uint32_t count)
7000```
7001
7002**Description**
7003
7004Pointer 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.
7005
7006**Since**: 10
7007
7008**Parameters**
7009
7010| Name| Description|
7011| -------- | -------- |
7012| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
7013| value | Pointer to the data to covert.|
7014| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
7015
7016**Returns**
7017
7018Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7019
7020**See**
7021
7022[OH_VObject](_o_h___v_object.md).
7023
7024
7025### putNull
7026
7027```
7028int(*putNull) (OH_VBucket *bucket, const char *field)
7029```
7030
7031**Description**
7032
7033Pointer to the function used to put a null value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
7034
7035**Since**: 10
7036
7037**Parameters**
7038
7039| Name| Description|
7040| -------- | -------- |
7041| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
7042| field | Pointer to the column name in the database table.|
7043
7044**Returns**
7045
7046Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7047
7048**See**
7049
7050[OH_VBucket](_o_h___v_bucket.md).
7051
7052
7053### putReal
7054
7055```
7056int(*putReal) (OH_VBucket *bucket, const char *field, double value)
7057```
7058
7059**Description**
7060
7061Pointer to the function used to put a double value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
7062
7063**Since**: 10
7064
7065**Parameters**
7066
7067| Name| Description|
7068| -------- | -------- |
7069| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
7070| field | Pointer to the column name in the database table.|
7071| value | Pointer to the value to put.|
7072
7073**Returns**
7074
7075Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7076
7077**See**
7078
7079[OH_VBucket](_o_h___v_bucket.md).
7080
7081
7082### putText [1/2]
7083
7084```
7085int(*putText) (OH_VBucket *bucket, const char *field, const char *value)
7086```
7087
7088**Description**
7089
7090Pointer to the function used to put a char value into an [OH_VBucket](_o_h___v_bucket.md) object in the given column.
7091
7092**Since**: 10
7093
7094**Parameters**
7095
7096| Name| Description|
7097| -------- | -------- |
7098| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance.|
7099| field | Pointer to the column name in the database table.|
7100| value | Pointer to the value to put.|
7101
7102**Returns**
7103
7104Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7105
7106**See**
7107
7108[OH_VBucket](_o_h___v_bucket.md).
7109
7110
7111### putText [2/2]
7112
7113```
7114int(*putText) (OH_VObject *valueObject, const char *value)
7115```
7116
7117**Description**
7118
7119Pointer 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.
7120
7121**Since**: 10
7122
7123**Parameters**
7124
7125| Name| Description|
7126| -------- | -------- |
7127| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
7128| value | Pointer to the character array to convert.|
7129
7130**Returns**
7131
7132Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7133
7134**See**
7135
7136[OH_VObject](_o_h___v_object.md).
7137
7138
7139### putTexts
7140
7141```
7142int(*putTexts) (OH_VObject *valueObject, const char **value, uint32_t count)
7143```
7144
7145**Description**
7146
7147Pointer 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.
7148
7149**Since**: 10
7150
7151**Parameters**
7152
7153| Name| Description|
7154| -------- | -------- |
7155| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
7156| value | Double pointer to the string array to convert.|
7157| count | Length of the string array to convert.|
7158
7159**Returns**
7160
7161Returns **RDB_OK** if the operation is successful; returns an error code otherwise.
7162
7163**See**
7164
7165[OH_VObject](_o_h___v_object.md).
7166
7167
7168### real
7169
7170```
7171double Rdb_KeyInfo::Rdb_KeyData::real
7172```
7173
7174**Description**
7175
7176Data of the double type.
7177
7178
7179### remained
7180
7181```
7182int Rdb_Statistic::remained
7183```
7184
7185**Description**
7186
7187Number of rows that are not executed for device-cloud sync in the database table.
7188
7189
7190### schedule
7191
7192```
7193int Rdb_ProgressDetails::schedule
7194```
7195
7196**Description**
7197
7198Device-cloud sync process.
7199
7200
7201### securityLevel
7202
7203```
7204int OH_Rdb_Config::securityLevel
7205```
7206
7207**Description**
7208
7209RDB store security level. For details, see [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel).
7210
7211
7212### selfSize
7213
7214```
7215int OH_Rdb_Config::selfSize
7216```
7217
7218**Description**
7219
7220Size of the struct.
7221
7222
7223### storeName
7224
7225```
7226const char* OH_Rdb_Config::storeName
7227```
7228
7229**Description**
7230
7231Name of the RDB store.
7232
7233
7234### successful
7235
7236```
7237int Rdb_Statistic::successful
7238```
7239
7240**Description**
7241
7242Number of rows that are successfully synced between the device and cloud in the database table.
7243
7244
7245### table
7246
7247```
7248const char* Rdb_TableDetails::table
7249```
7250
7251**Description**
7252
7253Database table name.
7254
7255
7256### tableLength
7257
7258```
7259int32_t Rdb_ProgressDetails::tableLength
7260```
7261
7262**Description**
7263
7264Number of the tables synced between the device and cloud.
7265
7266
7267### tableName
7268
7269```
7270const char* Rdb_ChangeInfo::tableName
7271```
7272
7273**Description**
7274
7275Name of the table with data changes.
7276
7277
7278### text
7279
7280```
7281const char* Rdb_KeyInfo::Rdb_KeyData::text
7282```
7283
7284**Description**
7285
7286Data of the char \* type.
7287
7288
7289### total
7290
7291```
7292int Rdb_Statistic::total
7293```
7294
7295**Description**
7296
7297Total number of rows to be synced between the device and cloud in the database table.
7298
7299
7300### type
7301
7302```
7303int Rdb_KeyInfo::type
7304```
7305
7306**Description**
7307
7308[OH_ColumnType](#oh_columntype) of the primary key.
7309
7310
7311### updated
7312
7313```
7314Rdb_KeyInfo Rdb_ChangeInfo::updated
7315```
7316
7317**Description**
7318
7319Location where data is updated. If the primary key of the table is of the string type, it is the value of the primary key. Otherwise, the value is the row number of the updated data.
7320
7321
7322### upload
7323
7324```
7325Rdb_Statistic Rdb_TableDetails::upload
7326```
7327
7328**Description**
7329
7330Statistics of the device-cloud upload tasks.
7331
7332
7333### version [1/3]
7334
7335```
7336int Rdb_DistributedConfig::version
7337```
7338
7339**Description**
7340
7341Version of the **Rdb_DistributedConfig** struct.
7342
7343
7344### version [2/3]
7345
7346```
7347int Rdb_ChangeInfo::version
7348```
7349
7350**Description**
7351
7352Version of the **Rdb_DistributedConfig** struct.
7353
7354
7355### version [3/3]
7356
7357```
7358int Rdb_ProgressDetails::version
7359```
7360
7361**Description**
7362
7363Version of the **OH_TableDetails** struct.
7364