1# RDB 2 3 4## Overview 5 6The relational database (RDB) store manages data based on relational models. The RDB store provides a complete mechanism for managing local databases based on the underlying SQLite. It provides a series of methods for performing operations, such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements to satisfy different needs in complicated scenarios. 7 8**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 the RDB store.<br>**File to include**: <database/rdb/oh_cursor.h><br>**Library**: libnative_rdb_ndk.z.so<br>| 21| [oh_predicates.h](oh__predicates_8h.md) | Defines the predicates for RDB stores.<br>**File to include**: <database/rdb/oh_predicates.h><br>**Library**: libnative_rdb_ndk.z.so<br>| 22| [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>| 23| [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>| 24| [relational_store.h](relational__store_8h.md) | Defines APIs for managing an RDB store.<br>**File to include**: <database/rdb/relational_store.h><br>**Library**: libnative_rdb_ndk.z.so<br>| 25| [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 | 26 27 28### Structs 29 30| Name | Description | 31| -------- | -------- | 32| [OH_Cursor](_o_h___cursor.md) | Defines a result set. | 33| [OH_Predicates](_o_h___predicates.md) | Defines a **predicates** object. | 34| [OH_VObject](_o_h___v_object.md) | Defines the allowed data field types. | 35| [OH_VBucket](_o_h___v_bucket.md) | Defines the types of the key and value in a KV pair. | 36| [OH_Rdb_Config](_o_h___rdb___config.md) | Defines the RDB store configuration. | 37| [OH_Rdb_Store](_o_h___rdb___store.md) | Defines the RDB store type. | 38| [Rdb_DistributedConfig](_rdb___distributed_config.md) | Defines the distributed configuration of a table. | 39| [Rdb_KeyInfo](_rdb___key_info.md) | Defines the primary key or row number of the row that changes. | 40| [Rdb_KeyInfo::Rdb_KeyData](union_rdb___key_info_1_1_rdb___key_data.md) | Defines the changed data. | 41| [Rdb_ChangeInfo](_rdb___change_info.md) | Defines the details about the device-cloud sync process. | 42| [Rdb_SubscribeCallback](union_rdb___subscribe_callback.md) | Defines a callback used to return the subscribed event. | 43| [Rdb_DataObserver](_rdb___data_observer.md) | Defines the data observer. | 44| [Rdb_Statistic](_rdb___statistic.md) | Defines the device-cloud sync statistics of a database table. | 45| [Rdb_TableDetails](_rdb___table_details.md) | Defines the statistics of device-cloud upload and download tasks of a database table. | 46| [Rdb_ProgressDetails](_rdb___progress_details.md) | Defines the statistics of the overall device-cloud sync (upload and download) tasks of an RDB store. | 47| [Rdb_ProgressObserver](_rdb___progress_observer.md) | Defines the observer of the device-cloud sync progress. | 48 49 50### Macros 51 52| Name | Description | 53| -------- | -------- | 54| [DISTRIBUTED_CONFIG_VERSION](#distributed_config_version) 1 | Version of [Rdb_DistributedConfig](_rdb___distributed_config.md). | 55| [DISTRIBUTED_CHANGE_INFO_VERSION](#distributed_change_info_version) 1 | Version of [Rdb_ChangeInfo](_rdb___change_info.md). | 56| [DISTRIBUTED_PROGRESS_DETAIL_VERSION](#distributed_progress_detail_version) 1 | Version of [Rdb_ProgressDetails](_rdb___progress_details.md). | 57 58 59### Types 60 61| Name | Description | 62| -------- | -------- | 63| [OH_ColumnType](#oh_columntype) | Defines an enum for the field types in an RDB store. | 64| [OH_Cursor](#oh_cursor) | Defines a struct for a result set. | 65| [OH_OrderType](#oh_ordertype) | Defines an enum for sorting types. | 66| [OH_Predicates](#oh_predicates) | Defines a **predicates** object. | 67| [OH_VObject](#oh_vobject) | Defines a struct for allowed data field types. | 68| [OH_VBucket](#oh_vbucket) | Defines a struct for the types of the key and value in a KV pair. | 69| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel) | Defines an enum for RDB store security levels. | 70| [Rdb_SecurityArea](#rdb_securityarea) | Defines an enum for security area levels of an RDB store. | 71| [Rdb_DistributedType](#rdb_distributedtype) | Defines an enum for distributed types. | 72| [Rdb_DistributedConfig](#rdb_distributedconfig) | Defines a struct for distributed configuration of a table. | 73| [Rdb_ChangeType](#rdb_changetype) | Defines an enum for data change types. | 74| [Rdb_KeyInfo](#rdb_keyinfo) | Defines a struct for the primary key or row number of the row that changes. | 75| [Rdb_ChangeInfo](#rdb_changeinfo) | Defines a struct for the details about the device-cloud sync process. | 76| [Rdb_SubscribeType](#rdb_subscribetype) | Defines an enum for subscription types. | 77| [Rdb_BriefObserver](#rdb_briefobserver) | Defines a callback used to return the device-cloud data change event. | 78| [Rdb_DetailsObserver](#rdb_detailsobserver) | Defines a callback used to return the details about the device-cloud data change. | 79| [Rdb_SubscribeCallback](#rdb_subscribecallback) | Defines a callback used to return the subscribed event. | 80| [Rdb_DataObserver](#rdb_dataobserver) | Defines a struct for the data observer. | 81| [Rdb_SyncMode](#rdb_syncmode) | Defines an enum for RDB store sync modes. | 82| [Rdb_Statistic](#rdb_statistic) | Defines a struct for the device-cloud sync statistics of a database table. | 83| [Rdb_TableDetails](#rdb_tabledetails) | Defines a struct for statistics of device-cloud upload and download tasks of a database table. | 84| [Rdb_Progress](#rdb_progress) | Defines an enum for device-cloud sync progresses. | 85| [Rdb_ProgressCode](#rdb_progresscode) | Defines an enum for device-cloud sync states. | 86| [Rdb_ProgressDetails](#rdb_progressdetails) | Defines a struct for statistics of the overall device-cloud sync (upload and download) tasks of an RDB store. | 87| [Rdb_ProgressCallback](#rdb_progresscallback) | Defines a callback used to return the device-cloud sync progress. | 88| [Rdb_SyncCallback](#rdb_synccallback) | Defines a callback for device-cloud sync. | 89| [Rdb_ProgressObserver](#rdb_progressobserver) | Defines the observer of the device-cloud sync progress. | 90| [OH_Rdb_ErrCode](#oh_rdb_errcode) | Defines an enum for error codes. | 91 92 93### Enums 94 95| Name | Description | 96| -------- | -------- | 97| [OH_ColumnType](#oh_columntype-1) {<br>TYPE_NULL = 0, TYPE_INT64, TYPE_REAL, TYPE_TEXT,<br>TYPE_BLOB, TYPE_ASSET, TYPE_ASSETS<br>} | Enumerates the types of the fields in an RDB store. | 98| [OH_OrderType](#oh_ordertype-1) { ASC = 0, DESC = 1 } | Enumerates the sorting types. | 99| [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel-1) { S1 = 1, S2, S3, S4 } | Enumerates the RDB store security levels. | 100| [Rdb_SecurityArea](#rdb_securityarea-1) { RDB_SECURITY_AREA_EL1 = 1, RDB_SECURITY_AREA_EL2, RDB_SECURITY_AREA_EL3, RDB_SECURITY_AREA_EL4 } | Enumerates the security area levels of an RDB store. | 101| [Rdb_DistributedType](#rdb_distributedtype-1) { RDB_DISTRIBUTED_CLOUD } | Enumerates the distributed types. | 102| [Rdb_ChangeType](#rdb_changetype-1) { RDB_DATA_CHANGE, RDB_ASSET_CHANGE } | Enumerates the data change types. | 103| [Rdb_SubscribeType](#rdb_subscribetype-1) { RDB_SUBSCRIBE_TYPE_CLOUD, RDB_SUBSCRIBE_TYPE_CLOUD_DETAILS, RDB_SUBSCRIBE_TYPE_LOCAL_DETAILS } | Enumerates the subscription types. | 104| [Rdb_SyncMode](#rdb_syncmode-1) { RDB_SYNC_MODE_TIME_FIRST, RDB_SYNC_MODE_NATIVE_FIRST, RDB_SYNC_MODE_CLOUD_FIRST } | Enumerates the RDB sync modes. | 105| [Rdb_Progress](#rdb_progress-1) { RDB_SYNC_BEGIN, RDB_SYNC_IN_PROGRESS, RDB_SYNC_FINISH } | Enumerates the device-cloud sync progresses. | 106| [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. | 107| [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>} | Enumerates the RDB store error codes. | 108 109 110### Functions 111 112| Name | Description | 113| -------- | -------- | 114| [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 the [OH_VBucket](_o_h___v_bucket.md) object with the given column name. | 115| [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 with the given column name. | 116| [OH_Rdb_CreateValueObject](#oh_rdb_createvalueobject) () | Creates an [OH_VObject](_o_h___v_object.md) instance. | 117| [OH_Rdb_CreateValuesBucket](#oh_rdb_createvaluesbucket) () | Creates an [OH_VBucket](_o_h___v_bucket.md) instance. | 118| [OH_Rdb_CreatePredicates](#oh_rdb_createpredicates) (const char \*table) | Creates an [OH_Predicates](_o_h___predicates.md) instance. | 119| [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. | 120| [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. | 121| [OH_Rdb_DeleteStore](#oh_rdb_deletestore) (const [OH_Rdb_Config](_o_h___rdb___config.md) \*config) | Deletes an RDB store with the specified database file configuration. | 122| [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. | 123| [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. | 124| [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. | 125| [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. | 126| [OH_Rdb_Execute](#oh_rdb_execute) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Executes an SQL statement but returns no value. | 127| [OH_Rdb_ExecuteQuery](#oh_rdb_executequery) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*sql) | Executes the SQL statement to query data in an RDB store. | 128| [OH_Rdb_BeginTransaction](#oh_rdb_begintransaction) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Starts the transaction before executing the SQL statement. | 129| [OH_Rdb_RollBack](#oh_rdb_rollback) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Rolls back the SQL statements executed. | 130| [OH_Rdb_Commit](#oh_rdb_commit) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store) | Commits the executed SQL statements. | 131| [OH_Rdb_Backup](#oh_rdb_backup) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Backs up an RDB store in the specified directory. | 132| [OH_Rdb_Restore](#oh_rdb_restore) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, const char \*databasePath) | Restores an RDB store from the specified database backup file. | 133| [OH_Rdb_GetVersion](#oh_rdb_getversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int \*version) | Obtains the RDB store version. | 134| [OH_Rdb_SetVersion](#oh_rdb_setversion) ([OH_Rdb_Store](_o_h___rdb___store.md) \*store, int version) | Sets the RDB store version. | 135| [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. | 136| [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. | 137| [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. | 138| [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. | 139| [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. | 140| [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. | 141| [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 automatic sync progress of an RDB store. The registered callback will be invoked to return the automatic sync progress. | 142| [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 automatic sync process of an RDB store. | 143| 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. | 144| 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. | 145| [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. | 146 147### Variables 148 149| Name | Description | 150| -------- | -------- | 151| [OH_Cursor::id](#id-15) | Unique identifier of the **OH_Cursor** struct. | 152| [OH_Cursor::getColumnCount](#getcolumncount) | Pointer to the function used to obtain the number of columns in the result set. | 153| [OH_Cursor::getColumnType](#getcolumntype) | Pointer to the function used to obtain the column type based on the specified column index. | 154| [OH_Cursor::getColumnIndex](#getcolumnindex) | Pointer to the function used to obtain the column index based on the specified column name. | 155| [OH_Cursor::getColumnName](#getcolumnname) | Pointer to the function used to obtain the column name based on the specified column index. | 156| [OH_Cursor::getRowCount](#getrowcount) | Pointer to the function used to obtain the number of rows in the result set. | 157| [OH_Cursor::goToNextRow](#gotonextrow) | Pointer to the function used to go to the next row of the result set. | 158| [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**. | 159| [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. | 160| [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. | 161| [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. | 162| [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. | 163| [OH_Cursor::isNull](#isnull-12) | Pointer to the function used to check whether the value in the specified column is null. | 164| [OH_Cursor::destroy](#destroy-14) | Pointer to the function used to destroy a result set. | 165| [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. | 166| [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. | 167| [OH_Predicates::id](#id-25) | Unique identifier of the **OH_Predicates** struct. | 168| [OH_Predicates::equalTo](#equalto) | Pointer to the function used to set a predicates object to match the field whose value is equal to the specified value. | 169| [OH_Predicates::notEqualTo](#notequalto) | Pointer to the function used to set a predicates object to match the field whose value is not equal to the specified value. | 170| [OH_Predicates::beginWrap](#beginwrap) | Pointer to the function used to add a left parenthesis to the predicates. | 171| [OH_Predicates::endWrap](#endwrap) | Pointer to the function used to add a right parenthesis to the predicates. | 172| [OH_Predicates::orOperate](#oroperate) | Pointer to the function used to add the OR operator to the predicates. | 173| [OH_Predicates::andOperate](#andoperate) | Pointer to the function used to add the AND operator to the predicates. | 174| [OH_Predicates::isNull](#isnull-22) | Pointer to the function used to set a predicates object to match the field whose value is null. | 175| [OH_Predicates::isNotNull](#isnotnull) | Pointer to the function used to set a predicates object to match the field whose value is not null. | 176| [OH_Predicates::like](#like) | Pointer to the function used to set a predicates object to match a string that is similar to the specified value. | 177| [OH_Predicates::between](#between) | Pointer to the function used to set a predicates object to match the field whose value is within the specified range. | 178| [OH_Predicates::notBetween](#notbetween) | Pointer to the function used to set a predicates object to match the field whose value is out of the specified range. | 179| [OH_Predicates::greaterThan](#greaterthan) | Pointer to the function used to set a predicates object to match the field with value greater than the specified value. | 180| [OH_Predicates::lessThan](#lessthan) | Pointer to the function used to set a predicates object to match the field with value less than the specified value. | 181| [OH_Predicates::greaterThanOrEqualTo](#greaterthanorequalto) | Pointer to the function used to set a predicates object to match the field with value greater than or equal to the specified value. | 182| [OH_Predicates::lessThanOrEqualTo](#lessthanorequalto) | Pointer to the function used to set a predicates object to match the field with value less than or equal to the specified value. | 183| [OH_Predicates::orderBy](#orderby) | Pointer to the function used to set a predicates object to sort the values in a column in ascending or descending order. | 184| [OH_Predicates::distinct](#distinct) | Pointer to the function used to set a predicates object to filter out duplicate records. | 185| [OH_Predicates::limit](#limit) | Pointer to the function used to set a predicates object to specify the maximum number of records. | 186| [OH_Predicates::offset](#offset) | Pointer to the function used to set a predicates object to specify the start position of the returned result. | 187| [OH_Predicates::groupBy](#groupby) | Pointer to the function used to set a predicates object to group rows that have the same value into summary rows. | 188| [OH_Predicates::in](#in) | Pointer to the function used to set a predicates object to match the field with the value within the specified range. | 189| [OH_Predicates::notIn](#notin) | Pointer to the function used to set a predicates object to match the field with the value out of the specified range. | 190| [OH_Predicates::clear](#clear-12) | Pointer to the function used to clear a predicates instance. | 191| [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. | 192| [OH_VObject::id](#id-35) | Unique identifier of the **OH_VObject** struct. | 193| [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. | 194| [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. | 195| [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. | 196| [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. | 197| [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. | 198| [OH_VBucket::id](#id-45) | Unique identifier of the **OH_VBucket** struct. | 199| [OH_VBucket::capability](#capability) | Number of the KV pairs in the struct. | 200| [OH_VBucket::putText](#puttext-12) | Pointer to the function used to put a char value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. | 201| [OH_VBucket::putInt64](#putint64-12) | Pointer to the function used to put an int64_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. | 202| [OH_VBucket::putReal](#putreal) | Pointer to the function used to put a double value into the {OH_VBucket} object in the given column.| 203| [OH_VBucket::putBlob](#putblob) | Pointer to the function used to put a const uint8_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. | 204| [OH_VBucket::putNull](#putnull) | Pointer to the function used to put a null value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. | 205| [OH_VBucket::clear](#clear-22) | Pointer to the function used to clear an [OH_VBucket](_o_h___v_bucket.md) object. | 206| [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. | 207| [OH_Rdb_Config::selfSize](#selfsize) | Size of the struct. | 208| [OH_Rdb_Config::dataBaseDir](#databasedir) | Path of the database file. | 209| [OH_Rdb_Config::storeName](#storename) | Name of the RDB store. | 210| [OH_Rdb_Config::bundleName](#bundlename) | Bundle name. | 211| [OH_Rdb_Config::moduleName](#modulename) | Module name. | 212| [OH_Rdb_Config::isEncrypt](#isencrypt) | Whether to encrypt the RDB store. | 213| [OH_Rdb_Config::securityLevel](#securitylevel) | RDB store security level. For details, see [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel). | 214| [OH_Rdb_Config::area](#area) | Security area level. For details, see [Rdb_SecurityArea](#rdb_securityarea). | 215| [OH_Rdb_Store::id](#id-55) | Unique identifier of the **OH_Rdb_Store** struct. | 216| [Rdb_DistributedConfig::version](#version-13) | Version of the **Rdb_DistributedConfig** struct. | 217| [Rdb_DistributedConfig::isAutoSync](#isautosync) | Whether the table supports automatic sync. | 218| [Rdb_KeyInfo::count](#count) | Number of the changed primary keys or row numbers. | 219| [Rdb_KeyInfo::type](#type) | Type ([OH_ColumnType](#oh_columntype)) of the primary key. | 220| [Rdb_KeyInfo::Rdb_KeyData::integer](#integer) | Data of the uint64_t type. | 221| [Rdb_KeyInfo::Rdb_KeyData::real](#real) | Data of the double type. | 222| [Rdb_KeyInfo::Rdb_KeyData::text](#text) | Data of the char \* type. | 223| [Rdb_KeyInfo::data](_rdb___key_info.md#member-variables) | Changed data. | 224| [Rdb_ChangeInfo::version](#version-23) | Version of the **Rdb_DistributedConfig** struct. | 225| [Rdb_ChangeInfo::tableName](#tablename) | Name of the table with data changes. | 226| [Rdb_ChangeInfo::ChangeType](#changetype) | Type of the data changed, which can be data or asset. | 227| [Rdb_ChangeInfo::inserted](#inserted) | Location where data is inserted. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the inserted data. | 228| [Rdb_ChangeInfo::updated](#updated) | Location where data is updated. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the updated data. | 229| [Rdb_ChangeInfo::deleted](#deleted) | Location where data is deleted. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the deleted data. | 230| [Rdb_SubscribeCallback::detailsObserver](#detailsobserver) | Callback used to return the details about the device-cloud data change. | 231| [Rdb_SubscribeCallback::briefObserver](#briefobserver) | Callback used to return the device-cloud data change event. | 232| [Rdb_DataObserver::context](#context-12) | Context of the data observer. | 233| [Rdb_DataObserver::callback](#callback-12) | Callback used to return the result.| 234| [Rdb_Statistic::total](#total) | Total number of rows to be synchronized between the device and cloud in the database table. | 235| [Rdb_Statistic::successful](#successful) | Number of rows that are successfully synchronized between the device and cloud in the database table. | 236| [Rdb_Statistic::failed](#failed) | Number of rows that failed to be synchronized between the device and cloud in the database table. | 237| [Rdb_Statistic::remained](#remained) | Number of rows that are not executed for device-cloud sync in the database table. | 238| [Rdb_TableDetails::table](#table) | Database table name. | 239| [Rdb_TableDetails::upload](#upload) | Statistics of the device-cloud upload tasks. | 240| [Rdb_TableDetails::download](#download) | Statistics of the device-cloud download tasks. | 241| [Rdb_ProgressDetails::version](#version-33) | Version of the **OH_TableDetails** struct. | 242| [Rdb_ProgressDetails::schedule](#schedule) | Device-cloud sync process. | 243| [Rdb_ProgressDetails::code](#code) | Device-cloud sync state. | 244| [Rdb_ProgressDetails::tableLength](#tablelength) | Number of the tables synchronized between the device and cloud. | 245| [Rdb_ProgressObserver::context](#context-22) | Context of the device-cloud sync progress observer. | 246| [Rdb_ProgressObserver::callback](#callback-22) | Callback used to return the device-cloud sync progress.| 247 248 249## Macro Description 250 251 252### DISTRIBUTED_CHANGE_INFO_VERSION 253 254``` 255#define DISTRIBUTED_CHANGE_INFO_VERSION 1 256``` 257 258**Description** 259 260Version of [Rdb_ChangeInfo](_rdb___change_info.md). 261 262**Since**: 11 263 264 265### DISTRIBUTED_CONFIG_VERSION 266 267``` 268#define DISTRIBUTED_CONFIG_VERSION 1 269``` 270 271**Description** 272 273Version of [Rdb_DistributedConfig](_rdb___distributed_config.md). 274 275**Since**: 11 276 277 278### DISTRIBUTED_PROGRESS_DETAIL_VERSION 279 280``` 281#define DISTRIBUTED_PROGRESS_DETAIL_VERSION 1 282``` 283 284**Description** 285 286Version of **OH_ProgressDetails**. 287 288**Since**: 11 289 290 291## Type Description 292 293 294### OH_ColumnType 295 296``` 297typedef enum OH_ColumnType OH_ColumnType 298``` 299 300**Description** 301 302Defines an enum for the types of the fields in an RDB store. 303 304**Since**: 10 305 306 307### OH_Cursor 308 309``` 310typedef struct OH_Cursor OH_Cursor 311``` 312 313**Description** 314 315Defines a struct for a result set. 316 317APIs are provided to access the result set obtained by querying the RDB store. 318 319**Since**: 10 320 321 322### OH_OrderType 323 324``` 325typedef enum OH_OrderType OH_OrderType 326``` 327 328**Description** 329 330Defines an enum for sorting types. 331 332**Since**: 10 333 334 335### OH_Predicates 336 337``` 338typedef struct OH_Predicates OH_Predicates 339``` 340 341**Description** 342 343Defines a **predicates** object. 344 345**Since**: 10 346 347 348### OH_Rdb_ErrCode 349 350``` 351typedef enum OH_Rdb_ErrCode OH_Rdb_ErrCode 352``` 353 354**Description** 355 356Defines an enum for error codes. 357 358**Since**: 10 359 360 361### OH_Rdb_SecurityLevel 362 363``` 364typedef enum OH_Rdb_SecurityLevel OH_Rdb_SecurityLevel 365``` 366 367**Description** 368 369Defines an enum for RDB store security levels. 370 371**Since**: 10 372 373 374### OH_VBucket 375 376``` 377typedef struct OH_VBucket OH_VBucket 378``` 379 380**Description** 381 382Defines a struct for the types of the key and value in a KV pair. 383 384**Since**: 10 385 386 387### OH_VObject 388 389``` 390typedef struct OH_VObject OH_VObject 391``` 392 393**Description** 394 395Defines a struct for allowed data types. 396 397**Since**: 10 398 399 400### Rdb_BriefObserver 401 402``` 403typedef void(* Rdb_BriefObserver) (void *context, const char *values[], uint32_t count) 404``` 405 406**Description** 407 408Defines a callback used to return the device-cloud data change event. 409 410**Since**: 11 411 412**Parameters** 413 414| Name | Description | 415| -------- | -------- | 416| context | Pointer to the context of the data observer. | 417| values | Pointer to the accounts whose device-cloud data is changed.| 418| count | Number of accounts whose device-cloud data is changed.| 419 420 421### Rdb_ChangeInfo 422 423``` 424typedef struct Rdb_ChangeInfo Rdb_ChangeInfo 425``` 426 427**Description** 428 429Defines a struct for the details about the device-cloud sync process. 430 431**Since**: 11 432 433 434### Rdb_ChangeType 435 436``` 437typedef enum Rdb_ChangeType Rdb_ChangeType 438``` 439 440**Description** 441 442Defines an enum for data change types. 443 444**Since**: 11 445 446 447### Rdb_DataObserver 448 449``` 450typedef struct Rdb_DataObserver Rdb_DataObserver 451``` 452 453**Description** 454 455Defines a struct for the data observer. 456 457**Since**: 11 458 459 460### Rdb_DetailsObserver 461 462``` 463typedef void(* Rdb_DetailsObserver) (void *context, const Rdb_ChangeInfo **changeInfo, uint32_t count) 464``` 465 466**Description** 467 468Defines a callback used to return the details about the device-cloud data change. 469 470**Since**: 11 471 472**Parameters** 473 474| Name | Description | 475| -------- | -------- | 476| context | Pointer to the context of the data observer. | 477| changeInfo | Pointer to [Rdb_ChangeInfo](_rdb___change_info.md). | 478| count | Number of changed tables. | 479 480**See** 481 482[Rdb_ChangeInfo](_rdb___change_info.md). 483 484 485### Rdb_DistributedConfig 486 487``` 488typedef struct Rdb_DistributedConfig Rdb_DistributedConfig 489``` 490 491**Description** 492 493Defines a struct for distributed configuration of a table. 494 495**Since**: 11 496 497 498### Rdb_DistributedType 499 500``` 501typedef enum Rdb_DistributedType Rdb_DistributedType 502``` 503 504**Description** 505 506Defines an enum for distributed types. 507 508**Since**: 11 509 510 511### Rdb_KeyInfo 512 513``` 514typedef struct Rdb_KeyInfo Rdb_KeyInfo 515``` 516 517**Description** 518 519Defines a struct for the primary key or row number of the row that changes. 520 521**Since**: 11 522 523 524### Rdb_Progress 525 526``` 527typedef enum Rdb_Progress Rdb_Progress 528``` 529 530**Description** 531 532Defines an enum for device-cloud sync progresses. 533 534**Since**: 11 535 536 537### Rdb_ProgressCallback 538 539``` 540typedef void(* Rdb_ProgressCallback) (void *context, Rdb_ProgressDetails *progressDetails) 541``` 542 543**Description** 544 545Defines a callback used to return the device-cloud sync progress. 546 547**Since**: 11 548 549**Parameters** 550 551| Name | Description | 552| -------- | -------- | 553| progressDetails | Details about the device-cloud sync progress. | 554 555**See** 556 557[Rdb_ProgressDetails](_rdb___progress_details.md). 558 559 560### Rdb_ProgressCode 561 562``` 563typedef enum Rdb_ProgressCode Rdb_ProgressCode 564``` 565 566**Description** 567 568Defines an enum for device-cloud sync states. 569 570**Since**: 11 571 572 573### Rdb_ProgressDetails 574 575``` 576typedef struct Rdb_ProgressDetails Rdb_ProgressDetails 577``` 578 579**Description** 580 581Defines a struct for statistics of the overall device-cloud sync (upload and download) tasks of an RDB store. 582 583**Since**: 11 584 585 586### Rdb_ProgressObserver 587 588``` 589typedef struct Rdb_ProgressObserver Rdb_ProgressObserver 590``` 591 592**Description** 593 594Defines a struct for the observer for the device-cloud sync progress. 595 596**Since**: 11 597 598 599### Rdb_SecurityArea 600 601``` 602typedef enum Rdb_SecurityArea Rdb_SecurityArea 603``` 604 605**Description** 606 607Defines an enum for security area levels of an RDB store. 608 609**Since**: 11 610 611 612### Rdb_Statistic 613 614``` 615typedef struct Rdb_Statistic Rdb_Statistic 616``` 617 618**Description** 619 620Defines a struct for the device-cloud sync statistics of a database table. 621 622**Since**: 11 623 624 625### Rdb_SubscribeCallback 626 627``` 628typedef union Rdb_SubscribeCallback Rdb_SubscribeCallback 629``` 630 631**Description** 632 633Defines a callback used to return the subscribed event. 634 635**Since**: 11 636 637 638### Rdb_SubscribeType 639 640``` 641typedef enum Rdb_SubscribeType Rdb_SubscribeType 642``` 643 644**Description** 645 646Defines an enum for subscription types. 647 648**Since**: 11 649 650 651### Rdb_SyncCallback 652 653``` 654typedef void(* Rdb_SyncCallback) (Rdb_ProgressDetails *progressDetails) 655``` 656 657**Description** 658 659Defines a callback for device-cloud sync. 660 661**Since**: 11 662 663**Parameters** 664 665| Name | Description | 666| -------- | -------- | 667| progressDetails | Statistics of device-cloud sync. | 668 669**See** 670 671[OH_Rdb_Store](_o_h___rdb___store.md). 672 673 674### Rdb_SyncMode 675 676``` 677typedef enum Rdb_SyncMode Rdb_SyncMode 678``` 679 680**Description** 681 682Defines an enum for RDB sync modes. 683 684**Since**: 11 685 686 687### Rdb_TableDetails 688 689``` 690typedef struct Rdb_TableDetails Rdb_TableDetails 691``` 692 693**Description** 694 695Defines a struct for statistics of device-cloud upload and download tasks of a database table. 696 697**Since**: 11 698 699## Enum Description 700 701 702### OH_ColumnType 703 704``` 705enum OH_ColumnType 706``` 707 708**Description** 709 710Enumerates the field types in an RDB store. 711 712**Since**: 10 713 714| Value | Description | 715| -------- | -------- | 716| TYPE_NULL | Null. | 717| TYPE_INT64 | INT64. | 718| TYPE_REAL | REAL. | 719| TYPE_TEXT | TEXT. | 720| TYPE_BLOB | BLOB. | 721| TYPE_ASSET<sup>11+</sup> | ASSET (asset attachment).<br>This value is supported since API version 11. | 722| TYPE_ASSETS<sup>11+</sup> | ASSETS (multiple asset attachments).<br>This value is supported since API version 11. | 723 724 725### OH_OrderType 726 727``` 728enum OH_OrderType 729``` 730 731**Description** 732 733Enumerates the sorting types. 734 735**Since**: 10 736 737| Value | Description | 738| -------- | -------- | 739| ASC | Ascending order. | 740| DESC | Descending order. | 741 742 743### OH_Rdb_ErrCode 744 745``` 746enum OH_Rdb_ErrCode 747``` 748 749**Description** 750 751Enumerates the error codes. 752 753**Since**: 10 754 755| Value | Description | 756| -------- | -------- | 757| RDB_ERR | Execution failed. | 758| RDB_OK | Execution successful. | 759| E_BASE | Base of the error code. | 760| RDB_E_NOT_SUPPORTED | The RDB store does not have this capability. | 761| RDB_E_ERROR | Common exception. | 762| RDB_E_INVALID_ARGS | Invalid parameter. | 763| RDB_E_CANNOT_UPDATE_READONLY | Failed to update data because the RDB store is read-only. | 764| RDB_E_REMOVE_FILE | Failed to delete the file. | 765| RDB_E_EMPTY_TABLE_NAME | The table name is empty. | 766| RDB_E_EMPTY_VALUES_BUCKET | The content of the KV pair is empty. | 767| RDB_E_EXECUTE_IN_STEP_QUERY | The SQL statement executed during the query is incorrect. | 768| RDB_E_INVALID_COLUMN_INDEX | The column index is invalid. | 769| RDB_E_INVALID_COLUMN_TYPE | The column type is invalid. | 770| RDB_E_EMPTY_FILE_NAME | The file name is empty. | 771| RDB_E_INVALID_FILE_PATH | The file path is invalid. | 772| RDB_E_TRANSACTION_IN_EXECUTE | Failed to start the transaction. | 773| RDB_E_INVALID_STATEMENT | Failed to precompile the SQL statements. | 774| RDB_E_EXECUTE_WRITE_IN_READ_CONNECTION | Failed to perform a write operation in a read connection. | 775| RDB_E_BEGIN_TRANSACTION_IN_READ_CONNECTION | Failed to start the transaction in a read connection. | 776| RDB_E_NO_TRANSACTION_IN_SESSION | The transaction to start does not exist in the database session. | 777| RDB_E_MORE_STEP_QUERY_IN_ONE_SESSION | Multiple queries are executed in a database session. | 778| RDB_E_NO_ROW_IN_QUERY | The result set does not contain any record. | 779| RDB_E_INVALID_BIND_ARGS_COUNT | The number of parameters bound in the SQL statement is invalid. | 780| RDB_E_INVALID_OBJECT_TYPE | The object type is invalid. | 781| RDB_E_INVALID_CONFLICT_FLAG | The conflict resolution type is invalid. | 782| RDB_E_HAVING_CLAUSE_NOT_IN_GROUP_BY | The HAVING keyword can be used only after GROUP BY. | 783| RDB_E_NOT_SUPPORTED_BY_STEP_RESULT_SET | The result set by step is not supported. | 784| RDB_E_STEP_RESULT_SET_CROSS_THREADS | Failed to obtain the result set. | 785| RDB_E_STEP_RESULT_QUERY_NOT_EXECUTED | The result set query statement is not executed. | 786| RDB_E_STEP_RESULT_IS_AFTER_LAST | The cursor of the result set is already in the last row. | 787| RDB_E_STEP_RESULT_QUERY_EXCEEDED | The number of result set query times exceeds the limit. | 788| RDB_E_STATEMENT_NOT_PREPARED | The SQL statement is not precompiled. | 789| RDB_E_EXECUTE_RESULT_INCORRECT | The database execution result is incorrect. | 790| RDB_E_STEP_RESULT_CLOSED | The result set has been closed. | 791| RDB_E_RELATIVE_PATH | The file path is a relative path. | 792| RDB_E_EMPTY_NEW_ENCRYPT_KEY | The new encrypt key is empty. | 793| RDB_E_CHANGE_UNENCRYPTED_TO_ENCRYPTED | The RDB store is non-encrypted and cannot be changed. | 794| RDB_E_CHANGE_ENCRYPT_KEY_IN_BUSY | The database does not respond when the database key is updated. | 795| RDB_E_STEP_STATEMENT_NOT_INIT | The precompiled SQL statement is not initialized. | 796| RDB_E_NOT_SUPPORTED_ATTACH_IN_WAL_MODE | The WAL mode does not support the ATTACH operation. | 797| RDB_E_CREATE_FOLDER_FAIL | Failed to create the folder. | 798| RDB_E_SQLITE_SQL_BUILDER_NORMALIZE_FAIL | Failed to build the SQL statement. | 799| RDB_E_STORE_SESSION_NOT_GIVE_CONNECTION_TEMPORARILY | The database session does not provide a connection. | 800| RDB_E_STORE_SESSION_NO_CURRENT_TRANSACTION | The transaction does not exist in the database session. | 801| RDB_E_NOT_SUPPORT | The current operation is not supported. | 802| RDB_E_INVALID_PARCEL | The current PARCEL is invalid. | 803| RDB_E_QUERY_IN_EXECUTE | Failed to execute query. | 804| RDB_E_SET_PERSIST_WAL | Failed to set the persistence of the database file in WAL mode. | 805| RDB_E_DB_NOT_EXIST | The database does not exist. | 806| RDB_E_ARGS_READ_CON_OVERLOAD | The number of read connections to set is greater than the limit. | 807| RDB_E_WAL_SIZE_OVER_LIMIT | The WAL log file size exceeds the default value. | 808| RDB_E_CON_OVER_LIMIT | The number of database connections has reached the limit. | 809 810 811### OH_Rdb_SecurityLevel 812 813``` 814enum OH_Rdb_SecurityLevel 815``` 816 817**Description** 818 819Enumerates the RDB store security levels. 820 821**Since**: 10 822 823| Value | Description | 824| -------- | -------- | 825| S1 | The security level of the RDB store is low.<br>If data leakage occurs, minor impact will be caused. | 826| S2 | The security level of the RDB store is medium.<br>If data leakage occurs, moderate impact will be caused. | 827| S3 | The security level of the RDB store is high.<br>If data leakage occurs, major impact will be caused. | 828| S4 | The security level of the RDB store is critical.<br>If data leakage occurs, critical impact will be caused. | 829 830 831### Rdb_ChangeType 832 833``` 834enum Rdb_ChangeType 835``` 836 837**Description** 838 839Enumerates the data change types. 840 841**Since**: 11 842 843| Value | Description | 844| -------- | -------- | 845| RDB_DATA_CHANGE | Data change. | 846| RDB_ASSET_CHANGE | Asset change. | 847 848 849### Rdb_DistributedType 850 851``` 852enum Rdb_DistributedType 853``` 854 855**Description** 856 857Enumerates the distributed types. 858 859**Since**: 11 860 861| Value | Description | 862| -------- | -------- | 863| RDB_DISTRIBUTED_CLOUD | Distributed database tables for device-cloud sync. | 864 865 866### Rdb_Progress 867 868``` 869enum Rdb_Progress 870``` 871 872**Description** 873 874Enumerates the device-cloud sync progresses. 875 876**Since**: 11 877 878| Value | Description | 879| -------- | -------- | 880| RDB_SYNC_BEGIN | The device-cloud sync starts. | 881| RDB_SYNC_IN_PROGRESS | The device-cloud sync is in progress. | 882| RDB_SYNC_FINISH | The device-cloud sync is finished. | 883 884 885### Rdb_ProgressCode 886 887``` 888enum Rdb_ProgressCode 889``` 890 891**Description** 892 893Enumerates the device-cloud sync states. 894 895**Since**: 11 896 897| Value | Description | 898| -------- | -------- | 899| RDB_SUCCESS | The device-cloud sync is successful. | 900| RDB_UNKNOWN_ERROR | An unknown error occurs during the device-cloud sync. | 901| RDB_NETWORK_ERROR | A network error occurs during the device-cloud sync. | 902| RDB_CLOUD_DISABLED | The cloud is unavailable. | 903| RDB_LOCKED_BY_OTHERS | The device-cloud sync of another device is being performed. | 904| RDB_RECORD_LIMIT_EXCEEDED | The number of records or size of the data to be synchronized exceeds the maximum. The maximum value is configured on the cloud. | 905| RDB_NO_SPACE_FOR_ASSET | The remaining cloud space is less than the size of the data to be synchronized. | 906 907 908### Rdb_SecurityArea 909 910``` 911enum Rdb_SecurityArea 912``` 913 914**Description** 915 916Enumerates the security area levels of an RDB store. 917 918**Since**: 11 919 920| Value | Description | 921| -------- | -------- | 922| RDB_SECURITY_AREA_EL1 | Security area level 1. | 923| RDB_SECURITY_AREA_EL2 | Security area level 2. | 924| RDB_SECURITY_AREA_EL3 | Security area level 3. | 925| RDB_SECURITY_AREA_EL4 | Security area level 4. | 926 927 928### Rdb_SubscribeType 929 930``` 931enum Rdb_SubscribeType 932``` 933 934**Description** 935 936Enumerates the subscription types. 937 938**Since**: 11 939 940| Value | Description | 941| -------- | -------- | 942| RDB_SUBSCRIBE_TYPE_CLOUD | Subscription of cloud data changes. | 943| RDB_SUBSCRIBE_TYPE_CLOUD_DETAILS | Subscription of cloud data change details. | 944| RDB_SUBSCRIBE_TYPE_LOCAL_DETAILS<sup>12+</sup> | Subscribe to details of the local data change. This value is available since API version 12. | 945 946 947### Rdb_SyncMode 948 949``` 950enum Rdb_SyncMode 951``` 952 953**Description** 954 955Enumerates the RDB sync modes. 956 957**Since**: 11 958 959| Value | Description | 960| -------- | -------- | 961| RDB_SYNC_MODE_TIME_FIRST | Synchronize with the data with the latest modification time. | 962| RDB_SYNC_MODE_NATIVE_FIRST | Synchronize data from a local device to the cloud. | 963| RDB_SYNC_MODE_CLOUD_FIRST | Synchronize data from the cloud to a local device. | 964 965 966## Function Description 967 968 969### OH_Rdb_Backup() 970 971``` 972int OH_Rdb_Backup (OH_Rdb_Store *store, const char *databasePath ) 973``` 974 975**Description** 976 977Backs up an RDB store in the specified directory. 978 979**Since**: 10 980 981**Parameters** 982 983| Name | Description | 984| -------- | -------- | 985| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 986| databasePath | Pointer to the destination directory in which the RDB store is backed up. | 987 988**Returns** 989 990Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 991 992**See** 993 994[OH_Rdb_Store](_o_h___rdb___store.md). 995 996 997### OH_Rdb_BeginTransaction() 998 999``` 1000int OH_Rdb_BeginTransaction (OH_Rdb_Store *store) 1001``` 1002 1003**Description** 1004 1005Starts the transaction before executing the SQL statement. 1006 1007**Since**: 10 1008 1009**Parameters** 1010 1011| Name | Description | 1012| -------- | -------- | 1013| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1014 1015**Returns** 1016 1017Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1018 1019**See** 1020 1021[OH_Rdb_Store](_o_h___rdb___store.md). 1022 1023 1024### OH_Rdb_CloseStore() 1025 1026``` 1027int OH_Rdb_CloseStore (OH_Rdb_Store *store) 1028``` 1029 1030**Description** 1031 1032Closes an [OH_Rdb_Store](_o_h___rdb___store.md) object to reclaim the memory occupied. 1033 1034**Since**: 10 1035 1036**Parameters** 1037 1038| Name | Description | 1039| -------- | -------- | 1040| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1041 1042**Returns** 1043 1044Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1045 1046**See** 1047 1048[OH_Rdb_Store](_o_h___rdb___store.md). 1049 1050 1051### OH_Rdb_CloudSync() 1052 1053``` 1054int OH_Rdb_CloudSync (OH_Rdb_Store *store, Rdb_SyncMode mode, const char *tables, int count, const Rdb_ProgressObserver *observer ) 1055``` 1056 1057**Description** 1058 1059Performs device-cloud sync. 1060 1061**Since**: 11 1062 1063**Parameters** 1064 1065| Name | Description | 1066| -------- | -------- | 1067| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1068| mode | Sync mode [Rdb_SyncMode](#rdb_syncmode).| 1069| tables | Pointer to the names of the tables to be synchronized. | 1070| count | Number of tables to synchronize. If the value is **0**, all tables in the database are synchronized. | 1071| observer | Observer [Rdb_ProgressObserver](_rdb___progress_observer.md) of the device-cloud sync progress. | 1072 1073**Returns** 1074 1075Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1076 1077**See** 1078 1079[OH_Rdb_Store](_o_h___rdb___store.md). 1080 1081 1082### OH_Rdb_Commit() 1083 1084``` 1085int OH_Rdb_Commit (OH_Rdb_Store *store) 1086``` 1087 1088**Description** 1089 1090Commits the executed SQL statements. 1091 1092**Since**: 10 1093 1094**Parameters** 1095 1096| Name | Description | 1097| -------- | -------- | 1098| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1099 1100**Returns** 1101 1102Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1103 1104**See** 1105 1106[OH_Rdb_Store](_o_h___rdb___store.md). 1107 1108 1109### OH_Rdb_CreatePredicates() 1110 1111``` 1112OH_Predicates* OH_Rdb_CreatePredicates (const char *table) 1113``` 1114 1115**Description** 1116 1117Creates an [OH_Predicates](_o_h___predicates.md) instance. 1118 1119**Since**: 10 1120 1121**Parameters** 1122 1123| Name | Description | 1124| -------- | -------- | 1125| table | Pointer to the name of the database table. | 1126 1127**Returns** 1128 1129Returns the pointer to the [OH_Predicates](_o_h___predicates.md) instance created if the operation is successful; returns null otherwise. 1130 1131**See** 1132 1133[OH_Predicates](_o_h___predicates.md). 1134 1135 1136### OH_Rdb_CreateValueObject() 1137 1138``` 1139OH_VObject* OH_Rdb_CreateValueObject () 1140``` 1141 1142**Description** 1143 1144Creates an [OH_VObject](_o_h___v_object.md) instance. 1145 1146**Since**: 10 1147 1148**Returns** 1149 1150Returns the pointer to the [OH_VObject](_o_h___v_object.md) instance created if the operation is successful; returns null otherwise. 1151 1152**See** 1153 1154[OH_VObject](_o_h___v_object.md). 1155 1156 1157### OH_Rdb_CreateValuesBucket() 1158 1159``` 1160OH_VBucket* OH_Rdb_CreateValuesBucket () 1161``` 1162 1163**Description** 1164 1165Creates an [OH_VBucket](_o_h___v_bucket.md) instance. 1166 1167**Since**: 10 1168 1169**Returns** 1170 1171Returns the pointer to the [OH_VBucket](_o_h___v_bucket.md) instance created if the operation is successful; returns null otherwise. 1172 1173**See** 1174 1175[OH_VBucket](_o_h___v_bucket.md). 1176 1177 1178### OH_Rdb_Delete() 1179 1180``` 1181int OH_Rdb_Delete (OH_Rdb_Store *store, OH_Predicates *predicates ) 1182``` 1183 1184**Description** 1185 1186Deletes data from an RDB store based on specified conditions. 1187 1188**Since**: 10 1189 1190**Parameters** 1191 1192| Name | Description | 1193| -------- | -------- | 1194| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1195| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the deletion conditions. | 1196 1197**Returns** 1198 1199Returns the number of affected rows if the operation is successful; returns an error code otherwise. 1200 1201**See** 1202 1203[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md). 1204 1205 1206### OH_Rdb_DeleteStore() 1207 1208``` 1209int OH_Rdb_DeleteStore (const OH_Rdb_Config *config) 1210``` 1211 1212**Description** 1213 1214Deletes an RDB store with the specified database file configuration. 1215 1216**Since**: 10 1217 1218**Parameters** 1219 1220| Name | Description | 1221| -------- | -------- | 1222| config | Pointer to the configuration of the database. | 1223 1224**Returns** 1225 1226Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1227 1228 1229### OH_Rdb_Execute() 1230 1231``` 1232int OH_Rdb_Execute (OH_Rdb_Store *store, const char *sql ) 1233``` 1234 1235**Description** 1236 1237Executes an SQL statement but returns no value. 1238 1239**Since**: 10 1240 1241**Parameters** 1242 1243| Name | Description | 1244| -------- | -------- | 1245| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1246| sql | Pointer to the SQL statement to execute. | 1247 1248**Returns** 1249 1250Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1251 1252**See** 1253 1254[OH_Rdb_Store](_o_h___rdb___store.md). 1255 1256 1257### OH_Rdb_ExecuteQuery() 1258 1259``` 1260OH_Cursor* OH_Rdb_ExecuteQuery (OH_Rdb_Store *store, const char *sql ) 1261``` 1262 1263**Description** 1264 1265Executes the SQL statement to query data in an RDB store. 1266 1267**Since**: 10 1268 1269**Parameters** 1270 1271| Name | Description | 1272| -------- | -------- | 1273| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1274| sql | Pointer to the SQL statement to execute. | 1275 1276**Returns** 1277 1278Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise. 1279 1280**See** 1281 1282[OH_Rdb_Store](_o_h___rdb___store.md). 1283 1284 1285### OH_Rdb_FindModifyTime() 1286 1287``` 1288OH_Cursor* OH_Rdb_FindModifyTime (OH_Rdb_Store *store, const char *tableName, const char *columnName, OH_VObject *values ) 1289``` 1290 1291**Description** 1292 1293Obtains the last modification time of a table in an RDB store. 1294 1295**Since**: 11 1296 1297**Parameters** 1298 1299| Name | Description | 1300| -------- | -------- | 1301| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1302| tableName | Pointer to the target distributed database table. | 1303| columnName | Pointer to the column of the database table to query. | 1304| 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. | 1305 1306**Returns** 1307 1308Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1309 1310**See** 1311 1312[OH_Rdb_Store](_o_h___rdb___store.md). 1313 1314 1315### OH_Rdb_GetOrOpen() 1316 1317``` 1318OH_Rdb_Store* OH_Rdb_GetOrOpen (const OH_Rdb_Config *config, int *errCode ) 1319``` 1320 1321**Description** 1322 1323Obtains an [OH_Rdb_Store](_o_h___rdb___store.md) instance for RDB store operations. 1324 1325**Since**: 10 1326 1327**Parameters** 1328 1329| Name | Description | 1330| -------- | -------- | 1331| config | Pointer to the [OH_Rdb_Config](_o_h___rdb___config.md) instance, which specifies the database configuration. | 1332| errCode | Function execution status. | 1333 1334**Returns** 1335 1336Returns the pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance created if the operation is successful; returns null otherwise. 1337 1338**See** 1339 1340[OH_Rdb_Config](_o_h___rdb___config.md), [OH_Rdb_Store](_o_h___rdb___store.md). 1341 1342 1343### OH_Rdb_GetTableDetails() 1344 1345``` 1346Rdb_TableDetails* OH_Rdb_GetTableDetails (Rdb_ProgressDetails *progress, int32_t version ) 1347``` 1348 1349**Description** 1350 1351Obtains the device-cloud sync statistics of a table. 1352 1353**Since**: 11 1354 1355**Parameters** 1356 1357| Name | Description | 1358| -------- | -------- | 1359| progress | Pointer to the **OH_ProgressDetails** instance. | 1360| version | Version of [Rdb_ProgressDetails](_rdb___progress_details.md). | 1361 1362**Returns** 1363 1364Returns a pointer to [Rdb_TableDetails](_rdb___table_details.md) if the operation is successful; returns null otherwise. 1365 1366**See** 1367 1368[Rdb_ProgressDetails](_rdb___progress_details.md) 1369 1370[Rdb_TableDetails](_rdb___table_details.md) 1371 1372 1373### OH_Rdb_GetVersion() 1374 1375``` 1376int OH_Rdb_GetVersion (OH_Rdb_Store *store, int *version ) 1377``` 1378 1379**Description** 1380 1381Obtains the RDB store version. 1382 1383**Since**: 10 1384 1385**Parameters** 1386 1387| Name | Description | 1388| -------- | -------- | 1389| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1390| version | Pointer to the version obtained. | 1391 1392**Returns** 1393 1394Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1395 1396**See** 1397 1398[OH_Rdb_Store](_o_h___rdb___store.md). 1399 1400 1401### OH_Rdb_Insert() 1402 1403``` 1404int OH_Rdb_Insert (OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBucket ) 1405``` 1406 1407**Description** 1408 1409Inserts a row of data into a table. 1410 1411**Since**: 10 1412 1413**Parameters** 1414 1415| Name | Description | 1416| -------- | -------- | 1417| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1418| table | Pointer to the target table. | 1419| valuesBucket | Pointer to the data [OH_VBucket](_o_h___v_bucket.md) to insert. | 1420 1421**Returns** 1422 1423Returns the row ID if the operation is successful; returns an error code otherwise. 1424 1425**See** 1426 1427[OH_Rdb_Store](_o_h___rdb___store.md), [OH_VBucket](_o_h___v_bucket.md). 1428 1429### OH_Rdb_LockRow() 1430 1431``` 1432int OH_Rdb_LockRow (OH_Rdb_Store *store, OH_Predicates *predicates ) 1433``` 1434 1435**Description** 1436 1437Locks data in an RDB store based on specified conditions. The locked data will be blocked from the device-cloud sync. 1438 1439**Since**: 12 1440 1441**Parameters** 1442 1443| Name | Description | 1444| -------- | -------- | 1445| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1446| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the lock conditions. | 1447 1448**Returns** 1449 1450Result of the lock operation. 1451 1452**See** 1453 1454[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md). 1455 1456### OH_Rdb_Query() 1457 1458``` 1459OH_Cursor* OH_Rdb_Query (OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length ) 1460``` 1461 1462**Description** 1463 1464Queries data in an RDB store based on specified conditions. 1465 1466**Since**: 10 1467 1468**Parameters** 1469 1470| Name | Description | 1471| -------- | -------- | 1472| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1473| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the query conditions. | 1474| columnNames | Pointer to the columns to query. If this parameter is not specified, data of columns will be queried. | 1475| length | Length of the **columnNames** array. If <b>length</b> is greater than the length of <b>columnNames</b> array, out-of-bounds access occurs. | 1476 1477**Returns** 1478 1479Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise. 1480 1481**See** 1482 1483[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md), [OH_Cursor](_o_h___cursor.md). 1484 1485### OH_Rdb_QueryLockedRow() 1486 1487``` 1488OH_Cursor *OH_Rdb_QueryLockedRow (OH_Rdb_Store *store, OH_Predicates *predicates, const char *const *columnNames, int length ) 1489``` 1490 1491**Description** 1492 1493Queries the locked data in an RDB store. 1494 1495**Since**: 12 1496 1497**Parameters** 1498 1499| Name | Description | 1500| -------- | -------- | 1501| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1502| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the query conditions. | 1503| columnNames | Pointer to the columns to query. If this parameter is not specified, data of columns will be queried. | 1504| length | Length of the **columnNames** array. If <b>length</b> is greater than the length of <b>columnNames</b> array, out-of-bounds access occurs. | 1505 1506**Returns** 1507 1508Returns the pointer to the [OH_Cursor](_o_h___cursor.md) instance if the operation is successful; returns null otherwise. 1509 1510**See** 1511 1512[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md), [OH_Cursor](_o_h___cursor.md). 1513 1514### OH_Rdb_Restore() 1515 1516``` 1517int OH_Rdb_Restore (OH_Rdb_Store *store, const char *databasePath ) 1518``` 1519 1520**Description** 1521 1522Restores an RDB store from the specified database backup file. 1523 1524**Since**: 10 1525 1526**Parameters** 1527 1528| Name | Description | 1529| -------- | -------- | 1530| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1531| databasePath | Pointer to the destination directory in which the RDB store is backed up. | 1532 1533**Returns** 1534 1535Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1536 1537**See** 1538 1539[OH_Rdb_Store](_o_h___rdb___store.md). 1540 1541 1542### OH_Rdb_RollBack() 1543 1544``` 1545int OH_Rdb_RollBack (OH_Rdb_Store *store) 1546``` 1547 1548**Description** 1549 1550Rolls back the SQL statements executed. 1551 1552**Since**: 10 1553 1554**Parameters** 1555 1556| Name | Description | 1557| -------- | -------- | 1558| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1559 1560**Returns** 1561 1562Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1563 1564**See** 1565 1566[OH_Rdb_Store](_o_h___rdb___store.md). 1567 1568 1569### OH_Rdb_SetDistributedTables() 1570 1571``` 1572int OH_Rdb_SetDistributedTables (OH_Rdb_Store *store, const char *tables[], uint32_t count, Rdb_DistributedType type, const Rdb_DistributedConfig * config ) 1573``` 1574 1575**Description** 1576 1577Sets distributed database tables. 1578 1579**Since**: 11 1580 1581**Parameters** 1582 1583| Name | Description | 1584| -------- | -------- | 1585| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1586| tables | Pointer to the names of the distributed tables to set. | 1587| count | Number of distributed database tables to be set. | 1588| type | [Rdb_DistributedType](#rdb_distributedtype). | 1589| config | Configuration of the distributed mode. For details, see [Rdb_DistributedConfig](_rdb___distributed_config.md). | 1590 1591**Returns** 1592 1593Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1594 1595**See** 1596 1597[OH_Rdb_Store](_o_h___rdb___store.md). 1598 1599 1600### OH_Rdb_SetVersion() 1601 1602``` 1603int OH_Rdb_SetVersion (OH_Rdb_Store *store, int version ) 1604``` 1605 1606**Description** 1607 1608Sets the RDB store version. 1609 1610**Since**: 10 1611 1612**Parameters** 1613 1614| Name | Description | 1615| -------- | -------- | 1616| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1617| version | Version to set. | 1618 1619**Returns** 1620 1621Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1622 1623**See** 1624 1625[OH_Rdb_Store](_o_h___rdb___store.md). 1626 1627 1628### OH_Rdb_Subscribe() 1629 1630``` 1631int OH_Rdb_Subscribe (OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer ) 1632``` 1633 1634**Description** 1635 1636Registers an observer for an RDB store. When data in the RDB store changes, a callback will be invoked to return the data changes. 1637 1638**Since**: 11 1639 1640**Parameters** 1641 1642| Name | Description | 1643| -------- | -------- | 1644| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1645| type | Subscription type defined in [Rdb_SubscribeType](#rdb_subscribetype). | 1646| observer | Pointer to the [Rdb_DataObserver](_rdb___data_observer.md) instance. | 1647 1648**Returns** 1649 1650Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1651 1652**See** 1653 1654[OH_Rdb_Store](_o_h___rdb___store.md). 1655 1656[Rdb_DataObserver](_rdb___data_observer.md). 1657 1658 1659### OH_Rdb_SubscribeAutoSyncProgress() 1660 1661``` 1662int OH_Rdb_SubscribeAutoSyncProgress (OH_Rdb_Store *store, const Rdb_ProgressObserver *observer ) 1663``` 1664 1665**Description** 1666 1667Subscribes to the automatic sync progress of an RDB store. The registered callback will be invoked to return the automatic sync progress. 1668 1669**Since**: 11 1670 1671**Parameters** 1672 1673| Name | Description | 1674| -------- | -------- | 1675| store | Pointer to the target [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1676| observer | Pointer to the [Rdb_ProgressObserver](_rdb___progress_observer.md) instance, which invokes the callback to return the automatic sync progress. | 1677 1678**Returns** 1679 1680Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1681 1682**See** 1683 1684[OH_Rdb_Store](_o_h___rdb___store.md). 1685 1686[Rdb_ProgressObserver](_rdb___progress_observer.md). 1687 1688### OH_Rdb_UnlockRow() 1689 1690``` 1691int OH_Rdb_UnlockRow (OH_Rdb_Store *store, OH_Predicates *predicates ) 1692``` 1693 1694**Description** 1695 1696Unlocks data in an RDB store based on the specified conditions. 1697 1698**Since**: 12 1699 1700**Parameters** 1701 1702| Name | Description | 1703| -------- | -------- | 1704| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1705| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, which specifies the unlock conditions. | 1706 1707**Returns** 1708 1709Result of the unlock operation. 1710 1711**See** 1712 1713[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Predicates](_o_h___predicates.md). 1714 1715### OH_Rdb_Unsubscribe() 1716 1717``` 1718int OH_Rdb_Unsubscribe (OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer ) 1719``` 1720 1721**Description** 1722 1723Unregisters the observer of the specified type. 1724 1725**Since**: 11 1726 1727**Parameters** 1728 1729| Name | Description | 1730| -------- | -------- | 1731| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1732| type | Subscription type defined in [Rdb_SubscribeType](#rdb_subscribetype). | 1733| observer | Pointer to the [Rdb_DataObserver](_rdb___data_observer.md) instance. If this parameter is **nullptr**, all observers of this type will be unregistered. | 1734 1735**Returns** 1736 1737Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1738 1739**See** 1740 1741[OH_Rdb_Store](_o_h___rdb___store.md). 1742 1743[Rdb_DataObserver](_rdb___data_observer.md). 1744 1745 1746### OH_Rdb_UnsubscribeAutoSyncProgress() 1747 1748``` 1749int OH_Rdb_UnsubscribeAutoSyncProgress (OH_Rdb_Store *store, const Rdb_ProgressObserver *observer ) 1750``` 1751 1752**Description** 1753 1754Unsubscribes from the automatic sync process of an RDB store. 1755 1756**Since**: 11 1757 1758**Parameters** 1759 1760| Name | Description | 1761| -------- | -------- | 1762| store | Pointer to the target [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1763| observer | Pointer to [Rdb_ProgressObserver](_rdb___progress_observer.md). If the pointer is null, all callbacks for the automatic sync process will be unregistered. | 1764 1765**Returns** 1766 1767Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1768 1769**See** 1770 1771[OH_Rdb_Store](_o_h___rdb___store.md). 1772 1773[Rdb_ProgressObserver](_rdb___progress_observer.md). 1774 1775 1776### OH_Rdb_Update() 1777 1778``` 1779int OH_Rdb_Update (OH_Rdb_Store *store, OH_VBucket *valuesBucket, OH_Predicates *predicates ) 1780``` 1781 1782**Description** 1783 1784Updates data in an RDB store based on specified conditions. 1785 1786**Since**: 10 1787 1788**Parameters** 1789 1790| Name | Description | 1791| -------- | -------- | 1792| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance. | 1793| valuesBucket | Pointer to the new data [OH_VBucket](_o_h___v_bucket.md) to be updated to the table. | 1794| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance, specifying the update conditions. | 1795 1796**Returns** 1797 1798Returns the number of affected rows if the operation is successful; returns an error code otherwise. 1799 1800**See** 1801 1802[OH_Rdb_Store](_o_h___rdb___store.md), [OH_Bucket](_o_h___v_bucket.md), [OH_Predicates](_o_h___predicates.md). 1803 1804 1805### OH_VBucket_PutAsset() 1806 1807``` 1808int OH_VBucket_PutAsset (OH_VBucket *bucket, const char *field, OH_Asset *value ) 1809``` 1810 1811**Description** 1812 1813Puts an **OH_Asset** object into the [OH_VBucket](_o_h___v_bucket.md) object with the given column name. 1814 1815**Since**: 11 1816 1817**Parameters** 1818 1819| Name | Description | 1820| -------- | -------- | 1821| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 1822| field | Pointer to the column name in the database table. | 1823| value | Pointer to the value to put. | 1824 1825**Returns** 1826 1827Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1828 1829**See** 1830 1831[OH_VBucket](_o_h___v_bucket.md). 1832 1833 1834### OH_VBucket_PutAssets() 1835 1836``` 1837int OH_VBucket_PutAssets (OH_VBucket *bucket, const char *field, OH_Asset **value, int count ) 1838``` 1839 1840**Description** 1841 1842Puts an array of **OH_Asset** objects into the [OH_VBucket](_o_h___v_bucket.md) object with the given column name. 1843 1844**Since**: 11 1845 1846**Parameters** 1847 1848| Name | Description | 1849| -------- | -------- | 1850| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 1851| field | Pointer to the column name in the database table. | 1852| value | Pointer to the value to put. | 1853| count | Number of elements in the **OH_Asset** object array. | 1854 1855**Returns** 1856 1857Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 1858 1859**See** 1860 1861[OH_VBucket](_o_h___v_bucket.md). 1862 1863## Variable Description 1864 1865 1866### andOperate 1867 1868``` 1869OH_Predicates *(*andOperate) (OH_Predicates *predicates) 1870``` 1871 1872**Description** 1873 1874Pointer to the function used to add the AND operator to the predicates. 1875 1876This method is equivalent to **AND** in SQL statements. 1877 1878**Since**: 10 1879 1880**Parameters** 1881 1882| Name | Description | 1883| -------- | -------- | 1884| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 1885 1886**Returns** 1887 1888Returns the predicates with the AND operator. 1889 1890**See** 1891 1892[OH_Predicates](_o_h___predicates.md). 1893 1894 1895### area 1896 1897``` 1898int OH_Rdb_Config::area 1899``` 1900 1901**Description** 1902 1903Pointer to the function used to set [Rdb_SecurityArea](#rdb_securityarea). 1904 1905**Since**: 11 1906 1907 1908### beginWrap 1909 1910``` 1911OH_Predicates *(*beginWrap) (OH_Predicates *predicates) 1912``` 1913 1914**Description** 1915 1916Pointer to the function used to add a left parenthesis to the predicates. 1917 1918This method is equivalent to "(" in SQL statements. 1919 1920**Since**: 10 1921 1922**Parameters** 1923 1924| Name | Description | 1925| -------- | -------- | 1926| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 1927 1928**Returns** 1929 1930Returns the predicates with a left parenthesis. 1931 1932**See** 1933 1934[OH_Predicates](_o_h___predicates.md). 1935 1936 1937### between 1938 1939``` 1940OH_Predicates *(*between) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 1941``` 1942 1943**Description** 1944 1945Pointer to the function used to set a predicates object to match the field whose value is within the specified range. 1946 1947This method is equivalent to **BETWEEN** in SQL statements. 1948 1949**Since**: 10 1950 1951**Parameters** 1952 1953| Name | Description | 1954| -------- | -------- | 1955| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 1956| field | Pointer to the column name in the database table. | 1957| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the start and end values. | 1958 1959**Returns** 1960 1961Returns the predicates created. 1962 1963**See** 1964 1965[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 1966 1967 1968### briefObserver 1969 1970``` 1971Rdb_BriefObserver Rdb_SubscribeCallback::briefObserver 1972``` 1973 1974**Description** 1975 1976Callback used to return the device-cloud data change event. 1977 1978 1979### bundleName 1980 1981``` 1982const char* OH_Rdb_Config::bundleName 1983``` 1984 1985**Description** 1986 1987Bundle name. 1988 1989 1990### callback [1/2] 1991 1992``` 1993Rdb_SubscribeCallback Rdb_DataObserver::callback 1994``` 1995 1996**Description** 1997 1998Callback of the data observer. 1999 2000 2001### callback [2/2] 2002 2003``` 2004Rdb_ProgressCallback Rdb_ProgressObserver::callback 2005``` 2006 2007**Description** 2008 2009Callback used to return the device-cloud sync progress. 2010 2011 2012### capability 2013 2014``` 2015uint16_t OH_VBucket::capability 2016``` 2017 2018**Description** 2019 2020Number of the KV pairs in the struct. 2021 2022 2023### ChangeType 2024 2025``` 2026int Rdb_ChangeInfo::ChangeType 2027``` 2028 2029**Description** 2030 2031Type of the data changed, which can be data or asset. 2032 2033 2034### clear [1/2] 2035 2036``` 2037OH_Predicates *(*clear) (OH_Predicates *predicates) 2038``` 2039 2040**Description** 2041 2042Pointer to the function used to clear a predicates instance. 2043 2044**Since**: 10 2045 2046**Parameters** 2047 2048| Name | Description | 2049| -------- | -------- | 2050| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2051 2052**Returns** 2053 2054Returns the cleared predicates. 2055 2056**See** 2057 2058[OH_Predicates](_o_h___predicates.md). 2059 2060 2061### clear [2/2] 2062 2063``` 2064int(*clear) (OH_VBucket *bucket) 2065``` 2066 2067**Description** 2068 2069Pointer to the function used to clear an [OH_VBucket](_o_h___v_bucket.md) object. 2070 2071**Since**: 10 2072 2073**Parameters** 2074 2075| Name | Description | 2076| -------- | -------- | 2077| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 2078 2079**Returns** 2080 2081Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2082 2083**See** 2084 2085[OH_VBucket](_o_h___v_bucket.md). 2086 2087 2088### code 2089 2090``` 2091int Rdb_ProgressDetails::code 2092``` 2093 2094**Description** 2095 2096Device-cloud sync state. 2097 2098 2099### context [1/2] 2100 2101``` 2102void* Rdb_DataObserver::context 2103``` 2104 2105**Description** 2106 2107Context of the data observer. 2108 2109 2110### context [2/2] 2111 2112``` 2113void* Rdb_ProgressObserver::context 2114``` 2115 2116**Description** 2117 2118Context of the device-cloud sync progress observer. 2119 2120 2121### count 2122 2123``` 2124int Rdb_KeyInfo::count 2125``` 2126 2127**Description** 2128 2129Number of changed primary keys or row numbers. 2130 2131 2132### dataBaseDir 2133 2134``` 2135const char* OH_Rdb_Config::dataBaseDir 2136``` 2137 2138**Description** 2139 2140Path of the database file. 2141 2142 2143### deleted 2144 2145``` 2146Rdb_KeyInfo Rdb_ChangeInfo::deleted 2147``` 2148 2149**Description** 2150 2151Location where data is deleted. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the deleted data. 2152 2153 2154### destroy [1/4] 2155 2156``` 2157int(*destroy) (OH_Cursor *cursor) 2158``` 2159 2160**Description** 2161 2162Pointer to the function used to destroy a result set. 2163 2164**Since**: 10 2165 2166**Parameters** 2167 2168| Name | Description | 2169| -------- | -------- | 2170| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2171 2172**Returns** 2173 2174Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2175 2176**See** 2177 2178[OH_Cursor](_o_h___cursor.md). 2179 2180 2181### destroy [2/4] 2182 2183``` 2184int(*destroy) (OH_Predicates *predicates) 2185``` 2186 2187**Description** 2188 2189Pointer to the function used to destroy an [OH_Predicates](_o_h___predicates.md) object to reclaim the memory occupied. 2190 2191**Since**: 10 2192 2193**Parameters** 2194 2195| Name | Description | 2196| -------- | -------- | 2197| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2198 2199**Returns** 2200 2201Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2202 2203**See** 2204 2205[OH_Predicates](_o_h___predicates.md). 2206 2207 2208### destroy [3/4] 2209 2210``` 2211int(*destroy) (OH_VBucket *bucket) 2212``` 2213 2214**Description** 2215 2216Pointer to the function used to destroy an [OH_VBucket](_o_h___v_bucket.md) object to reclaim the memory occupied. 2217 2218**Since**: 10 2219 2220**Parameters** 2221 2222| Name | Description | 2223| -------- | -------- | 2224| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 2225 2226**Returns** 2227 2228Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2229 2230**See** 2231 2232[OH_VBucket](_o_h___v_bucket.md). 2233 2234 2235### destroy [4/4] 2236 2237``` 2238int(*destroy) (OH_VObject *valueObject) 2239``` 2240 2241**Description** 2242 2243Pointer to the function used to destroy an [OH_VObject](_o_h___v_object.md) object to reclaim the memory occupied. 2244 2245**Since**: 10 2246 2247**Parameters** 2248 2249| Name | Description | 2250| -------- | -------- | 2251| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance. | 2252 2253**Returns** 2254 2255Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2256 2257**See** 2258 2259[OH_VObject](_o_h___v_object.md). 2260 2261 2262### detailsObserver 2263 2264``` 2265Rdb_DetailsObserver Rdb_SubscribeCallback::detailsObserver 2266``` 2267 2268**Description** 2269 2270Callback used to return the details about the device-cloud data change. 2271 2272 2273### distinct 2274 2275``` 2276OH_Predicates *(*distinct) (OH_Predicates *predicates) 2277``` 2278 2279**Description** 2280 2281Pointer to the function used to set a predicates object to filter out duplicate records. 2282 2283This method is equivalent to **DISTINCT** in SQL statements. 2284 2285**Since**: 10 2286 2287**Parameters** 2288 2289| Name | Description | 2290| -------- | -------- | 2291| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2292 2293**Returns** 2294 2295Returns the predicates created. 2296 2297**See** 2298 2299[OH_Predicates](_o_h___predicates.md). 2300 2301 2302### download 2303 2304``` 2305Rdb_Statistic Rdb_TableDetails::download 2306``` 2307 2308**Description** 2309 2310Statistics of the device-cloud download tasks. 2311 2312 2313### endWrap 2314 2315``` 2316OH_Predicates *(*endWrap) (OH_Predicates *predicates) 2317``` 2318 2319**Description** 2320 2321Pointer to the function used to add a right parenthesis to the predicates. 2322 2323This method is equivalent to ")" in SQL statements. 2324 2325**Since**: 10 2326 2327**Parameters** 2328 2329| Name | Description | 2330| -------- | -------- | 2331| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2332 2333**Returns** 2334 2335Returns the predicates object with a right parenthesis. 2336 2337**See** 2338 2339[OH_Predicates](_o_h___predicates.md). 2340 2341 2342### equalTo 2343 2344``` 2345OH_Predicates *(*equalTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 2346``` 2347 2348**Description** 2349 2350Pointer to the function used to set a predicates object to match the field whose value is equal to the specified value. 2351 2352This method is equivalent to "=" in SQL statements. 2353 2354**Since**: 10 2355 2356**Parameters** 2357 2358| Name | Description | 2359| -------- | -------- | 2360| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2361| field | Pointer to the column name in the database table. | 2362| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 2363 2364**Returns** 2365 2366Returns the predicates created. 2367 2368**See** 2369 2370[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 2371 2372 2373### failed 2374 2375``` 2376int Rdb_Statistic::failed 2377``` 2378 2379**Description** 2380 2381Number of rows that failed to be synchronized between the device and cloud in the database table. 2382 2383 2384### getAsset 2385 2386``` 2387int(*getAsset) (OH_Cursor *cursor, int32_t columnIndex, Data_Asset *value) 2388``` 2389 2390**Description** 2391 2392Pointer to the function used to obtain the value of the asset type based on the specified column and the current row. 2393 2394**Since**: 11 2395 2396**Parameters** 2397 2398| Name | Description | 2399| -------- | -------- | 2400| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2401| columnIndex | Index of the column. The index value starts from **0**. | 2402| value | Pointer to the value obtained. | 2403 2404**Returns** 2405 2406Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2407 2408**See** 2409 2410[OH_Cursor](_o_h___cursor.md). 2411 2412 2413### getAssets 2414 2415``` 2416int(*getAssets) (OH_Cursor *cursor, int32_t columnIndex, Data_Asset **value, uint32_t length) 2417``` 2418 2419**Description** 2420 2421Pointer to the function used to obtain the values in the form of an asset array based on the specified column and the current row. 2422 2423**Since**: 11 2424 2425**Parameters** 2426 2427| Name | Description | 2428| -------- | -------- | 2429| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2430| columnIndex | Index of the column. The index value starts from **0**. | 2431| value | Pointer to the value obtained. | 2432| length | Length of an asset array. | 2433 2434**Returns** 2435 2436Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2437 2438**See** 2439 2440[OH_Cursor](_o_h___cursor.md). 2441 2442 2443### getBlob 2444 2445``` 2446int(*getBlob) (OH_Cursor *cursor, int32_t columnIndex, unsigned char *value, int length) 2447``` 2448 2449**Description** 2450 2451Pointer to the function used to obtain the values in the form of a byte array based on the specified column and the current row. 2452 2453**Since**: 10 2454 2455**Parameters** 2456 2457| Name | Description | 2458| -------- | -------- | 2459| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2460| columnIndex | Index of the column. The index value starts from **0**. | 2461| value | Pointer to the values in the form of a byte array obtained. | 2462| length | Length of the value, which can be obtained by **getSize()**. | 2463 2464**Returns** 2465 2466Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2467 2468**See** 2469 2470[OH_Cursor](_o_h___cursor.md). 2471 2472 2473### getColumnCount 2474 2475``` 2476int(*getColumnCount) (OH_Cursor *cursor, int *count) 2477``` 2478 2479**Description** 2480 2481Pointer to the function used to obtain the number of columns in the result set. 2482 2483**Since**: 10 2484 2485**Parameters** 2486 2487| Name | Description | 2488| -------- | -------- | 2489| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2490| count | Pointer to the number of columns in the result set obtained. | 2491 2492**Returns** 2493 2494Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2495 2496**See** 2497 2498[OH_Cursor](_o_h___cursor.md). 2499 2500 2501### getColumnIndex 2502 2503``` 2504int(*getColumnIndex) (OH_Cursor *cursor, const char *name, int *columnIndex) 2505``` 2506 2507**Description** 2508 2509Pointer to the function used to obtain the column index based on the specified column name. 2510 2511**Since**: 10 2512 2513**Parameters** 2514 2515| Name | Description | 2516| -------- | -------- | 2517| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2518| name | Pointer to the column name in the result set. | 2519| columnIndex | Pointer to the column index obtained. | 2520 2521**Returns** 2522 2523Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2524 2525**See** 2526 2527[OH_Cursor](_o_h___cursor.md). 2528 2529 2530### getColumnName 2531 2532``` 2533int(*getColumnName) (OH_Cursor *cursor, int32_t columnIndex, char *name, int length) 2534``` 2535 2536**Description** 2537 2538Pointer to the function used to obtain the column name based on the specified column index. 2539 2540**Since**: 10 2541 2542**Parameters** 2543 2544| Name | Description | 2545| -------- | -------- | 2546| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2547| columnIndex | Index of the column. The index value starts from **0**. | 2548| name | Pointer to the column name obtained. | 2549| length | Length of a column name. | 2550 2551**Returns** 2552 2553Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2554 2555**See** 2556 2557[OH_Cursor](_o_h___cursor.md). 2558 2559 2560### getColumnType 2561 2562``` 2563int(*getColumnType) (OH_Cursor *cursor, int32_t columnIndex, OH_ColumnType *columnType) 2564``` 2565 2566**Description** 2567 2568Pointer to the function used to obtain the column type based on the specified column index. 2569 2570**Since**: 10 2571 2572**Parameters** 2573 2574| Name | Description | 2575| -------- | -------- | 2576| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2577| columnIndex | Index of the column. The index value starts from **0**. | 2578| columnType | Pointer to the [OH_ColumnType](#oh_columntype) obtained. | 2579 2580**Returns** 2581 2582Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2583 2584**See** 2585 2586[OH_Cursor](_o_h___cursor.md), [OH_ColumnType](#oh_columntype). 2587 2588 2589### getInt64 2590 2591``` 2592int(*getInt64) (OH_Cursor *cursor, int32_t columnIndex, int64_t *value) 2593``` 2594 2595**Description** 2596 2597Pointer to the function used to obtain the value of the int64_t type based on the specified column and the current row. 2598 2599**Since**: 10 2600 2601**Parameters** 2602 2603| Name | Description | 2604| -------- | -------- | 2605| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2606| columnIndex | Index of the column. The index value starts from **0**. | 2607| value | Pointer to the value obtained. | 2608 2609**Returns** 2610 2611Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2612 2613**See** 2614 2615[OH_Cursor](_o_h___cursor.md). 2616 2617 2618### getReal 2619 2620``` 2621int(*getReal) (OH_Cursor *cursor, int32_t columnIndex, double *value) 2622``` 2623 2624**Description** 2625 2626Pointer to the function used to obtain the value of the double type based on the specified column and the current row. 2627 2628**Since**: 10 2629 2630**Parameters** 2631 2632| Name | Description | 2633| -------- | -------- | 2634| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2635| columnIndex | Index of the column. The index value starts from **0**. | 2636| value | Pointer to the value obtained. | 2637 2638**Returns** 2639 2640Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2641 2642**See** 2643 2644[OH_Cursor](_o_h___cursor.md). 2645 2646 2647### getRowCount 2648 2649``` 2650int(*getRowCount) (OH_Cursor *cursor, int *count) 2651``` 2652 2653**Description** 2654 2655Pointer to the function used to obtain the number of rows in the result set. 2656 2657**Since**: 10 2658 2659**Parameters** 2660 2661| Name | Description | 2662| -------- | -------- | 2663| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2664| count | Pointer to the number of columns in the result set obtained. | 2665 2666**Returns** 2667 2668Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2669 2670**See** 2671 2672[OH_Cursor](_o_h___cursor.md). 2673 2674 2675### getSize 2676 2677``` 2678int(*getSize) (OH_Cursor *cursor, int32_t columnIndex, size_t *size) 2679``` 2680 2681**Description** 2682 2683Pointer to the function used to obtain information about the memory required when the column data type in the result set is **BLOB** or **TEXT**. 2684 2685**Since**: 10 2686 2687**Parameters** 2688 2689| Name | Description | 2690| -------- | -------- | 2691| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2692| columnIndex | Index of the column. The index value starts from **0**. | 2693| size | Pointer to the memory size obtained. | 2694 2695**Returns** 2696 2697Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2698 2699**See** 2700 2701[OH_Cursor](_o_h___cursor.md). 2702 2703 2704### getText 2705 2706``` 2707int(*getText) (OH_Cursor *cursor, int32_t columnIndex, char *value, int length) 2708``` 2709 2710**Description** 2711 2712Pointer to the function used to obtain the value of the string type based on the specified column and the current row. 2713 2714**Since**: 10 2715 2716**Parameters** 2717 2718| Name | Description | 2719| -------- | -------- | 2720| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2721| columnIndex | Index of the column. The index value starts from **0**. | 2722| value | Pointer to the value of the string type obtained. | 2723| length | Length of the value, which can be obtained by **getSize()**. | 2724 2725**Returns** 2726 2727Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2728 2729**See** 2730 2731[OH_Cursor](_o_h___cursor.md). 2732 2733 2734### goToNextRow 2735 2736``` 2737int(*goToNextRow) (OH_Cursor *cursor) 2738``` 2739 2740**Description** 2741 2742Pointer to the function used to go to the next row of the result set. 2743 2744**Since**: 10 2745 2746**Parameters** 2747 2748| Name | Description | 2749| -------- | -------- | 2750| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 2751 2752**Returns** 2753 2754Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 2755 2756**See** 2757 2758[OH_Cursor](_o_h___cursor.md). 2759 2760 2761### greaterThan 2762 2763``` 2764OH_Predicates *(*greaterThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 2765``` 2766 2767**Description** 2768 2769Pointer to the function used to set a predicates object to match the field with value greater than the specified value. 2770 2771This method is equivalent to ">" in SQL statements. 2772 2773**Since**: 10 2774 2775**Parameters** 2776 2777| Name | Description | 2778| -------- | -------- | 2779| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2780| field | Pointer to the column name in the database table. | 2781| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 2782 2783**Returns** 2784 2785Returns the predicates created. 2786 2787**See** 2788 2789[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 2790 2791 2792### greaterThanOrEqualTo 2793 2794``` 2795OH_Predicates *(*greaterThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 2796``` 2797 2798**Description** 2799 2800Pointer to the function used to set a predicates object to match the field with value greater than or equal to the specified value. 2801 2802This method is equivalent to ">=" in SQL statements. 2803 2804**Since**: 10 2805 2806**Parameters** 2807 2808| Name | Description | 2809| -------- | -------- | 2810| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2811| field | Pointer to the column name in the database table. | 2812| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 2813 2814**Returns** 2815 2816Returns the predicates created. 2817 2818**See** 2819 2820[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 2821 2822 2823### groupBy 2824 2825``` 2826OH_Predicates *(*groupBy) (OH_Predicates *predicates, char const *const *fields, int length) 2827``` 2828 2829**Description** 2830 2831Pointer to the function used to set a predicates object to group rows that have the same value into summary rows. 2832 2833This method is equivalent to **GROUP BY** in SQL statements. 2834 2835**Since**: 10 2836 2837**Parameters** 2838 2839| Name | Description | 2840| -------- | -------- | 2841| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2842| fields | Pointer to the names of the columns by which the records are grouped. | 2843| length | Length of the **fields** value. | 2844 2845**Returns** 2846 2847Returns the predicates created. 2848 2849**See** 2850 2851[OH_Predicates](_o_h___predicates.md). 2852 2853 2854### id [1/5] 2855 2856``` 2857int64_t OH_Cursor::id 2858``` 2859 2860**Description** 2861 2862Unique identifier of the **OH_Cursor** struct. 2863 2864 2865### id [2/5] 2866 2867``` 2868int64_t OH_Predicates::id 2869``` 2870 2871**Description** 2872 2873Unique identifier of the **OH_Predicates** struct. 2874 2875 2876### id [3/5] 2877 2878``` 2879int64_t OH_VObject::id 2880``` 2881 2882**Description** 2883 2884Unique identifier of the **OH_VObject** struct. 2885 2886 2887### id [4/5] 2888 2889``` 2890int64_t OH_VBucket::id 2891``` 2892 2893**Description** 2894 2895Unique identifier of the **OH_VBucket** struct. 2896 2897 2898### id [5/5] 2899 2900``` 2901int64_t OH_Rdb_Store::id 2902``` 2903 2904**Description** 2905 2906Unique identifier of the **OH_Rdb_Store** struct. 2907 2908 2909### in 2910 2911``` 2912OH_Predicates *(*in) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 2913``` 2914 2915**Description** 2916 2917Pointer to the function used to set a predicates object to match the field with the value within the specified range. 2918 2919This method is equivalent to **IN** in SQL statements. 2920 2921**Since**: 10 2922 2923**Parameters** 2924 2925| Name | Description | 2926| -------- | -------- | 2927| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 2928| field | Pointer to the column name in the database table. | 2929| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value range.| 2930 2931**Returns** 2932 2933Returns the predicates created. 2934 2935**See** 2936 2937[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 2938 2939 2940### inserted 2941 2942``` 2943Rdb_KeyInfo Rdb_ChangeInfo::inserted 2944``` 2945 2946**Description** 2947 2948Location where data is inserted. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the inserted data. 2949 2950 2951### integer 2952 2953``` 2954uint64_t Rdb_KeyInfo::Rdb_KeyData::integer 2955``` 2956 2957**Description** 2958 2959Data of the uint64_t type. 2960 2961 2962### isAutoSync 2963 2964``` 2965bool Rdb_DistributedConfig::isAutoSync 2966``` 2967 2968**Description** 2969 2970Whether the table supports automatic sync. 2971 2972 2973### isEncrypt 2974 2975``` 2976bool OH_Rdb_Config::isEncrypt 2977``` 2978 2979**Description** 2980 2981Whether to encrypt the RDB store. 2982 2983 2984### isNotNull 2985 2986``` 2987OH_Predicates *(*isNotNull) (OH_Predicates *predicates, const char *field) 2988``` 2989 2990**Description** 2991 2992Pointer to the function used to set a predicates object to match the field whose value is not null. 2993 2994This method is equivalent to **IS NOT NULL** in SQL statements. 2995 2996**Since**: 10 2997 2998**Parameters** 2999 3000| Name | Description | 3001| -------- | -------- | 3002| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3003| field | Pointer to the column name in the database table. | 3004 3005**Returns** 3006 3007Returns the predicates created. 3008 3009**See** 3010 3011[OH_Predicates](_o_h___predicates.md). 3012 3013 3014### isNull [1/2] 3015 3016``` 3017int(*isNull) (OH_Cursor *cursor, int32_t columnIndex, bool *isNull) 3018``` 3019 3020**Description** 3021 3022Pointer to the function used to check whether the value in the specified column is null. 3023 3024**Since**: 10 3025 3026**Parameters** 3027 3028| Name | Description | 3029| -------- | -------- | 3030| cursor | Pointer to the [OH_Cursor](_o_h___cursor.md) instance. | 3031| columnIndex | Index of the column. The index value starts from **0**. | 3032| isNull | Pointer to the value returned. The value **true** means the value is null; the value **false** means the opposite. | 3033 3034**Returns** 3035 3036Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3037 3038**See** 3039 3040[OH_Cursor](_o_h___cursor.md). 3041 3042 3043### isNull [2/2] 3044 3045``` 3046OH_Predicates *(*isNull) (OH_Predicates *predicates, const char *field) 3047``` 3048 3049**Description** 3050 3051Pointer to the function used to set a predicates object to match the field whose value is null. 3052 3053This method is equivalent to **IS NULL** in SQL statements. 3054 3055**Since**: 10 3056 3057**Parameters** 3058 3059| Name | Description | 3060| -------- | -------- | 3061| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3062| field | Pointer to the column name in the database table. | 3063 3064**Returns** 3065 3066Returns the predicates created. 3067 3068**See** 3069 3070[OH_Predicates](_o_h___predicates.md). 3071 3072 3073### lessThan 3074 3075``` 3076OH_Predicates *(*lessThan) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3077``` 3078 3079**Description** 3080 3081Pointer to the function used to set a predicates object to match the field with value less than the specified value. 3082 3083This method is equivalent to "<" in SQL statements. 3084 3085**Since**: 10 3086 3087**Parameters** 3088 3089| Name | Description | 3090| -------- | -------- | 3091| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3092| field | Pointer to the column name in the database table. | 3093| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 3094 3095**Returns** 3096 3097Returns the predicates created. 3098 3099**See** 3100 3101[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3102 3103 3104### lessThanOrEqualTo 3105 3106``` 3107OH_Predicates *(*lessThanOrEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3108``` 3109 3110**Description** 3111 3112Pointer to the function used to set a predicates object to match the field with value less than or equal to the specified value. 3113 3114This method is equivalent to "<=" in SQL statements. 3115 3116**Since**: 10 3117 3118**Parameters** 3119 3120| Name | Description | 3121| -------- | -------- | 3122| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3123| field | Pointer to the column name in the database table. | 3124| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 3125 3126**Returns** 3127 3128Returns the predicates created. 3129 3130**See** 3131 3132[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3133 3134 3135### like 3136 3137``` 3138OH_Predicates *(*like) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3139``` 3140 3141**Description** 3142 3143Pointer to the function used to set a predicates object to match a string that is similar to the specified value. 3144 3145This method is equivalent to **LIKE** in SQL statements. 3146 3147**Since**: 10 3148 3149**Parameters** 3150 3151| Name | Description | 3152| -------- | -------- | 3153| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3154| field | Pointer to the column name in the database table. | 3155| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 3156 3157**Returns** 3158 3159Returns the predicates created. 3160 3161**See** 3162 3163[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3164 3165 3166### limit 3167 3168``` 3169OH_Predicates *(*limit) (OH_Predicates *predicates, unsigned int value) 3170``` 3171 3172**Description** 3173 3174Pointer to the function used to set a predicates object to specify the maximum number of records. 3175 3176This method is equivalent to **LIMIT** in SQL statements. 3177 3178**Since**: 10 3179 3180**Parameters** 3181 3182| Name | Description | 3183| -------- | -------- | 3184| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3185| value | Maximum number of data records. | 3186 3187**Returns** 3188 3189Returns the predicates created. 3190 3191**See** 3192 3193[OH_Predicates](_o_h___predicates.md). 3194 3195 3196### moduleName 3197 3198``` 3199const char* OH_Rdb_Config::moduleName 3200``` 3201 3202**Description** 3203 3204Module name. 3205 3206 3207### notBetween 3208 3209``` 3210OH_Predicates *(*notBetween) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3211``` 3212 3213**Description** 3214 3215Pointer to the function used to set a predicates object to match the field whose value is out of the specified range. 3216 3217This method is equivalent to **NOT BETWEEN** in SQL statements. 3218 3219**Since**: 10 3220 3221**Parameters** 3222 3223| Name | Description | 3224| -------- | -------- | 3225| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3226| field | Pointer to the column name in the database table. | 3227| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 3228 3229**Returns** 3230 3231Returns the predicates created. 3232 3233**See** 3234 3235[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3236 3237 3238### notEqualTo 3239 3240``` 3241OH_Predicates *(*notEqualTo) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3242``` 3243 3244**Description** 3245 3246Pointer to the function used to set a predicates object to match the field whose value is not equal to the specified value. 3247 3248This method is equivalent to "!=" in SQL statements. 3249 3250**Since**: 10 3251 3252**Parameters** 3253 3254| Name | Description | 3255| -------- | -------- | 3256| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3257| field | Pointer to the column name in the database table. | 3258| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value to match.| 3259 3260**Returns** 3261 3262Returns the predicates created. 3263 3264**See** 3265 3266[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3267 3268 3269### notIn 3270 3271``` 3272OH_Predicates *(*notIn) (OH_Predicates *predicates, const char *field, OH_VObject *valueObject) 3273``` 3274 3275**Description** 3276 3277Pointer to the function used to set a predicates object to match the field with the value out of the specified range. 3278 3279This method is equivalent to **NOT IN** in SQL statements. 3280 3281**Since**: 10 3282 3283**Parameters** 3284 3285| Name | Description | 3286| -------- | -------- | 3287| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3288| field | Pointer to the column name in the database table. | 3289| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance, which specifies the value range to match.| 3290 3291**Returns** 3292 3293Returns the predicates created. 3294 3295**See** 3296 3297[OH_Predicates](_o_h___predicates.md), [OH_VObject](_o_h___v_object.md). 3298 3299 3300### offset 3301 3302``` 3303OH_Predicates *(*offset) (OH_Predicates *predicates, unsigned int rowOffset) 3304``` 3305 3306**Description** 3307 3308Pointer to the function used to set a predicates object to specify the start position of the returned result. 3309 3310This method is equivalent to **OFFSET** in SQL statements. 3311 3312**Since**: 10 3313 3314**Parameters** 3315 3316| Name | Description | 3317| -------- | -------- | 3318| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3319| rowOffset | Start position of the returned result. The value is a positive integer. | 3320 3321**Returns** 3322 3323Returns the predicates created. 3324 3325**See** 3326 3327[OH_Predicates](_o_h___predicates.md). 3328 3329 3330### orderBy 3331 3332``` 3333OH_Predicates *(*orderBy) (OH_Predicates *predicates, const char *field, OH_OrderType type) 3334``` 3335 3336**Description** 3337 3338Pointer to the function used to set a predicates object to sort the values in a column in ascending or descending order. 3339 3340This method is equivalent to **ORDER BY** in SQL statements. 3341 3342**Since**: 10 3343 3344**Parameters** 3345 3346| Name | Description | 3347| -------- | -------- | 3348| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3349| field | Pointer to the column name in the database table. | 3350| type | Sorting type [OH_OrderType](#oh_ordertype). | 3351 3352**Returns** 3353 3354Returns the predicates created. 3355 3356**See** 3357 3358[OH_Predicates](_o_h___predicates.md), [OH_OrderType](#oh_ordertype). 3359 3360 3361### orOperate 3362 3363``` 3364OH_Predicates *(*orOperate) (OH_Predicates *predicates) 3365``` 3366 3367**Description** 3368 3369Pointer to the function used to add the OR operator to the predicates. 3370 3371This method is equivalent to **OR** in SQL statements. 3372 3373**Since**: 10 3374 3375**Parameters** 3376 3377| Name | Description | 3378| -------- | -------- | 3379| predicates | Pointer to the [OH_Predicates](_o_h___predicates.md) instance. | 3380 3381**Returns** 3382 3383Returns the predicates with the OR operator. 3384 3385**See** 3386 3387[OH_Predicates](_o_h___predicates.md). 3388 3389 3390### putBlob 3391 3392``` 3393int(*putBlob) (OH_VBucket *bucket, const char *field, const uint8_t *value, uint32_t size) 3394``` 3395 3396**Description** 3397 3398Pointer to the function used to put a const uint8_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. 3399 3400**Since**: 10 3401 3402**Parameters** 3403 3404| Name | Description | 3405| -------- | -------- | 3406| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 3407| field | Pointer to the column name in the database table. | 3408| value | Pointer to the value to put. | 3409| size | Length of the value. | 3410 3411**Returns** 3412 3413Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3414 3415**See** 3416 3417[OH_VBucket](_o_h___v_bucket.md). 3418 3419 3420### putDouble 3421 3422``` 3423int(*putDouble) (OH_VObject *valueObject, double *value, uint32_t count) 3424``` 3425 3426**Description** 3427 3428Pointer 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. 3429 3430**Since**: 10 3431 3432**Parameters** 3433 3434| Name | Description | 3435| -------- | -------- | 3436| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance. | 3437| value | Pointer to the data to covert. | 3438| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array. | 3439 3440**Returns** 3441 3442Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3443 3444**See** 3445 3446[OH_VObject](_o_h___v_object.md). 3447 3448 3449### putInt64 [1/2] 3450 3451``` 3452int(*putInt64) (OH_VBucket *bucket, const char *field, int64_t value) 3453``` 3454 3455**Description** 3456 3457Pointer to the function used to put an int64_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. 3458 3459**Since**: 10 3460 3461**Parameters** 3462 3463| Name | Description | 3464| -------- | -------- | 3465| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 3466| field | Pointer to the column name in the database table. | 3467| value | Value to put.| 3468 3469**Returns** 3470 3471Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3472 3473**See** 3474 3475[OH_VBucket](_o_h___v_bucket.md). 3476 3477 3478### putInt64 [2/2] 3479 3480``` 3481int(*putInt64) (OH_VObject *valueObject, int64_t *value, uint32_t count) 3482``` 3483 3484**Description** 3485 3486Pointer 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. 3487 3488**Since**: 10 3489 3490**Parameters** 3491 3492| Name | Description | 3493| -------- | -------- | 3494| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance. | 3495| value | Pointer to the data to covert. | 3496| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array. | 3497 3498**Returns** 3499 3500Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3501 3502**See** 3503 3504[OH_VObject](_o_h___v_object.md). 3505 3506 3507### putNull 3508 3509``` 3510int(*putNull) (OH_VBucket *bucket, const char *field) 3511``` 3512 3513**Description** 3514 3515Pointer to the function used to put a null value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. 3516 3517**Since**: 10 3518 3519**Parameters** 3520 3521| Name | Description | 3522| -------- | -------- | 3523| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 3524| field | Pointer to the column name in the database table. | 3525 3526**Returns** 3527 3528Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3529 3530**See** 3531 3532[OH_VBucket](_o_h___v_bucket.md). 3533 3534 3535### putReal 3536 3537``` 3538int(*putReal) (OH_VBucket *bucket, const char *field, double value) 3539``` 3540 3541**Description** 3542 3543Pointer to the function used to put a double value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. 3544 3545**Since**: 10 3546 3547**Parameters** 3548 3549| Name | Description | 3550| -------- | -------- | 3551| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 3552| field | Pointer to the column name in the database table. | 3553| value | Value to put.| 3554 3555**Returns** 3556 3557Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3558 3559**See** 3560 3561[OH_VBucket](_o_h___v_bucket.md). 3562 3563 3564### putText [1/2] 3565 3566``` 3567int(*putText) (OH_VBucket *bucket, const char *field, const char *value) 3568``` 3569 3570**Description** 3571 3572Pointer to the function used to put a char value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column. 3573 3574**Since**: 10 3575 3576**Parameters** 3577 3578| Name | Description | 3579| -------- | -------- | 3580| bucket | Pointer to the [OH_VBucket](_o_h___v_bucket.md) instance. | 3581| field | Pointer to the column name in the database table. | 3582| value | Pointer to the value to put. | 3583 3584**Returns** 3585 3586Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3587 3588**See** 3589 3590[OH_VBucket](_o_h___v_bucket.md). 3591 3592 3593### putText [2/2] 3594 3595``` 3596int(*putText) (OH_VObject *valueObject, const char *value) 3597``` 3598 3599**Description** 3600 3601Pointer 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. 3602 3603**Since**: 10 3604 3605**Parameters** 3606 3607| Name | Description | 3608| -------- | -------- | 3609| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance. | 3610| value | Pointer to the character array to convert. | 3611 3612**Returns** 3613 3614Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3615 3616**See** 3617 3618[OH_VObject](_o_h___v_object.md). 3619 3620 3621### putTexts 3622 3623``` 3624int(*putTexts) (OH_VObject *valueObject, const char **value, uint32_t count) 3625``` 3626 3627**Description** 3628 3629Pointer 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. 3630 3631**Since**: 10 3632 3633**Parameters** 3634 3635| Name | Description | 3636| -------- | -------- | 3637| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance. | 3638| value | Pointer to the string array to convert. | 3639| count | Length of the string array to convert. | 3640 3641**Returns** 3642 3643Returns **RDB_OK** if the operation is successful; returns an error code otherwise. 3644 3645**See** 3646 3647[OH_VObject](_o_h___v_object.md). 3648 3649 3650### real 3651 3652``` 3653double Rdb_KeyInfo::Rdb_KeyData::real 3654``` 3655 3656**Description** 3657 3658Data of the double type. 3659 3660 3661### remained 3662 3663``` 3664int Rdb_Statistic::remained 3665``` 3666 3667**Description** 3668 3669Number of rows that are not executed for device-cloud sync in the database table. 3670 3671 3672### schedule 3673 3674``` 3675int Rdb_ProgressDetails::schedule 3676``` 3677 3678**Description** 3679 3680Device-cloud sync process. 3681 3682 3683### securityLevel 3684 3685``` 3686int OH_Rdb_Config::securityLevel 3687``` 3688 3689**Description** 3690 3691RDB store security level. For details, see [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel). 3692 3693 3694### selfSize 3695 3696``` 3697int OH_Rdb_Config::selfSize 3698``` 3699 3700**Description** 3701 3702Size of the struct. 3703 3704 3705### storeName 3706 3707``` 3708const char* OH_Rdb_Config::storeName 3709``` 3710 3711**Description** 3712 3713Name of the RDB store. 3714 3715 3716### successful 3717 3718``` 3719int Rdb_Statistic::successful 3720``` 3721 3722**Description** 3723 3724Number of rows that are successfully synchronized between the device and cloud in the database table. 3725 3726 3727### table 3728 3729``` 3730const char* Rdb_TableDetails::table 3731``` 3732 3733**Description** 3734 3735Database table name. 3736 3737 3738### tableLength 3739 3740``` 3741int32_t Rdb_ProgressDetails::tableLength 3742``` 3743 3744**Description** 3745 3746Number of the tables synchronized between the device and cloud. 3747 3748 3749### tableName 3750 3751``` 3752const char* Rdb_ChangeInfo::tableName 3753``` 3754 3755**Description** 3756 3757Name of the table with data changes. 3758 3759 3760### text 3761 3762``` 3763const char* Rdb_KeyInfo::Rdb_KeyData::text 3764``` 3765 3766**Description** 3767 3768Data of the char \* type. 3769 3770 3771### total 3772 3773``` 3774int Rdb_Statistic::total 3775``` 3776 3777**Description** 3778 3779Total number of rows to be synchronized between the device and cloud in the database table. 3780 3781 3782### type 3783 3784``` 3785int Rdb_KeyInfo::type 3786``` 3787 3788**Description** 3789 3790Type ([OH_ColumnType](#oh_columntype)) of the primary key. 3791 3792 3793### updated 3794 3795``` 3796Rdb_KeyInfo Rdb_ChangeInfo::updated 3797``` 3798 3799**Description** 3800 3801Location where data is updated. If the primary key of the table is of the string type, the value is the value of the primary key. Otherwise, the value is the row number of the updated data. 3802 3803 3804### upload 3805 3806``` 3807Rdb_Statistic Rdb_TableDetails::upload 3808``` 3809 3810**Description** 3811 3812Statistics of the device-cloud upload tasks. 3813 3814 3815### version [1/3] 3816 3817``` 3818int Rdb_DistributedConfig::version 3819``` 3820 3821**Description** 3822 3823Version of the **Rdb_DistributedConfig** struct. 3824 3825 3826### version [2/3] 3827 3828``` 3829int Rdb_ChangeInfo::version 3830``` 3831 3832**Description** 3833 3834Version of the **Rdb_DistributedConfig** struct. 3835 3836 3837### version [3/3] 3838 3839``` 3840int Rdb_ProgressDetails::version 3841``` 3842 3843**Description** 3844 3845Version of the **OH_TableDetails** struct. 3846