It provides APIs to access the result set obtained by querying the RDB store.
**Since**
10
**Related Modules**
[RDB](_r_d_b.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [id](_r_d_b.md) | Unique identifier of the **OH_Cursor** struct.|
| [getColumnCount](_r_d_b.md#getcolumncount) | Pointer to the function used to obtain the number of columns in the result set.|
| [getColumnType](_r_d_b.md#getcolumntype) | Pointer to the function used to obtain the column type based on the specified column index.|
| [getColumnIndex](_r_d_b.md#getcolumnindex) | Pointer to the function used to obtain the column index based on the specified column name.|
| [getColumnName](_r_d_b.md#getcolumnname) | Pointer to the function used to obtain the column name based on the specified column index.|
| [getRowCount](_r_d_b.md#getrowcount) | Pointer to the function used to obtain the number of rows in the result set.|
| [goToNextRow](_r_d_b.md#gotonextrow) | Pointer to the function used to go to the next row of the result set.|
| [getSize](_r_d_b.md#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**.|
| [getText](_r_d_b.md#gettext) | Pointer to the function used to obtain the value in the form of a string based on the specified column and the current row.|
| [getInt64](_r_d_b.md#getint64) | Pointer to the function used to obtain the value of the int64_t type based on the specified column and the current row.|
| [getReal](_r_d_b.md#getreal) | Pointer to the function used to obtain the value of the double type based on the specified column and the current row.|
| [getBlob](_r_d_b.md#getblob) | Pointer to the function used to obtain the value in the form of a byte array based on the specified column and the current row.|
| [isNull](_r_d_b.md#isnull-12) | Pointer to the function used to check whether the value in the specified column is null.|
| [close](_r_d_b.md#close) | Pointer to the function used to close a result set.|
| [id](_r_d_b.md#id-14) | Unique identifier of the **OH_Predicates** struct.|
| [equalTo](_r_d_b.md#equalto) | Pointer to the function used to set a predicates object to match the field whose value is equal to the specified value.|
| [notEqualTo](_r_d_b.md#notequalto) | Pointer to the function used to set a predicates object to match the field whose value is not equal to the specified value.|
| [beginWrap](_r_d_b.md#beginwrap) | Pointer to the function used to add a left parenthesis to the predicates.|
| [endWrap](_r_d_b.md#endwrap) | Pointer to the function used to add a right parenthesis to the predicates.|
| [orOperate](_r_d_b.md#oroperate) | Pointer to the function used to add the OR operator to the predicates.|
| [andOperate](_r_d_b.md#andoperate) | Pointer to the function used to add the AND operator to the predicates.|
| [isNull](_r_d_b.md#isnull-22) | Pointer to the function used to set a predicates object to match the field whose value is null.|
| [isNotNull](_r_d_b.md#isnotnull) | Pointer to the function used to set a predicates object to match the field whose value is not null.|
| [like](_r_d_b.md#like) | Pointer to the function used to set a predicates object to match a string that is similar to the specified value.|
| [between](_r_d_b.md#between) | Pointer to the function used to set a predicates object to match the field whose value is within the specified range.|
| [notBetween](_r_d_b.md#notbetween) | Pointer to the function used to set a predicates object to match the field whose value is out of the specified range.|
| [greaterThan](_r_d_b.md#greaterthan) | Pointer to the function used to set a predicates object to match the field with value greater than the specified value.|
| [lessThan](_r_d_b.md#lessthan) | Pointer to the function used to set a predicates object to match the field with value less than the specified value.|
| [greaterThanOrEqualTo](_r_d_b.md#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.|
| [lessThanOrEqualTo](_r_d_b.md#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.|
| [orderBy](_r_d_b.md#orderby) | Pointer to the function used to set a predicates object to sort the values in a column in ascending or descending order.|
| [distinct](_r_d_b.md#distinct) | Pointer to the function used to set a predicates object to filter out duplicate records.|
| [limit](_r_d_b.md#limit) | Pointer to the function used to set a predicates object to specify the maximum number of records.|
| [offset](_r_d_b.md#offset) | Pointer to the function used to set a predicates object to specify the start position of the returned result.|
| [groupBy](_r_d_b.md#groupby) | Pointer to the function used to set a predicates object to group rows that have the same value into summary rows.|
| [in](_r_d_b.md#in) | Pointer to the function used to set a predicates object to match the field with the value within the specified range.|
| [notIn](_r_d_b.md#notin) | Pointer to the function used to set a predicates object to match the field with the value out of the specified range.|
| [clear](_r_d_b.md#clear-12) | Pointer to the function used to clear a predicates instance.|
| [destroyPredicates](_r_d_b.md#destroypredicates) | Destroys an **OH_Predicates** object and reclaims the memory occupied.|
The 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.
| [oh_cursor.h](oh__cursor_8h.md) | Provides APIs to access the result set obtained by querying the RDB store.<br>File to include: \<database/rdb/oh_cursor.h>|
| [oh_predicates.h](oh__predicates_8h.md) | Defines the predicates for RDB stores.<br>File to include: \<database/rdb/oh_predicates.h>|
| [oh_value_object.h](oh__value__object_8h.md) | Provides type conversion methods.<br>File to include: \<database/rdb/oh_value_object.h>|
| [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>|
| [relational_store.h](relational__store_8h.md) | Provides APIs to manage an RDB store.<br>File to include: \<database/rdb/relational_store.h>|
| [relational_store_error_code.h](relational__store__error__code_8h.md) | Declares the error codes used for RDB stores.<br>File to include: \<database/rdb/relational_error_code.h>|
### Structs
| Name| Description|
| -------- | -------- |
| [OH_Cursor](_o_h___cursor.md) | Defines a result set.|
| [OH_Predicates](_o_h___predicates.md) | Defines a **predicates** object.|
| [OH_VObject](_o_h___v_object.md) | Defines the allowed data field types.|
| [OH_VBucket](_o_h___v_bucket.md) | Defines the types of the key and value in a KV pair.|
| [OH_Rdb_Config](_o_h___rdb___config.md) | Defines the RDB store configuration.|
| [OH_Rdb_Store](_o_h___rdb___store.md) | Defines the RDB store type.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_Cursor](#oh_cursor) | Indicates a result set.|
| [OH_Predicates](#oh_predicates) | Indicates a **predicates** object.|
| [OH_VObject](#oh_vobject) | Indicates the allowed data field types.|
| [OH_VBucket](#oh_vbucket) | Indicates the types of the key and value in a KV pair.|
| [OH_ColumnType](#oh_columntype) {<br>TYPE_NULL = 0, TYPE_INT64, TYPE_REAL, TYPE_TEXT,<br>TYPE_BLOB<br>} | Enumerates the field types in an RDB store.|
| [OH_Rdb_CreateValueObject](#oh_rdb_createvalueobject)(void) | Creates an [OH_VObject](_o_h___v_object.md) instance.|
| [OH_Rdb_CreateValuesBucket](#oh_rdb_createvaluesbucket)(void) | Creates an [OH_VBucket](_o_h___v_bucket.md) instance.|
| [OH_Rdb_CreatePredicates](#oh_rdb_createpredicates)(const char \*table) | Creates an [OH_Predicates](_o_h___predicates.md) instance.|
| [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.|
| [OH_Rdb_CloseStore](#oh_rdb_closestore)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Destroys an [OH_Rdb_Store](_o_h___rdb___store.md) object and reclaims the memory occupied by the object.|
| [OH_Rdb_DeleteStore](#oh_rdb_deletestore)(const char \*path) | Deletes an RDB store with the specified database file configuration.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [OH_Rdb_BeginTransaction](#oh_rdb_begintransaction)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Starts the transaction before executing the SQL statement.|
| [OH_Rdb_RollBack](#oh_rdb_rollback)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Rolls back the SQL statements executed.|
| [OH_Rdb_Commit](#oh_rdb_commit)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Commits the executed SQL statements.|
| [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.|
| [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.|
| [OH_Rdb_GetVersion](#oh_rdb_getversion)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, int \*version) | Obtains the RDB store version.|
| [OH_Rdb_SetVersion](#oh_rdb_setversion)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, int version) | Sets the RDB store version.|
### Variables
| Name| Description|
| -------- | -------- |
| OH_Cursor::id | Unique identifier of the **OH_Cursor** struct.|
| [OH_Cursor::getColumnCount](#getcolumncount) | Pointer to the function used to obtain the number of columns in the result set.|
| [OH_Cursor::getColumnType](#getcolumntype) | Pointer to the function used to obtain the column type based on the specified column index.|
| [OH_Cursor::getColumnIndex](#getcolumnindex) | Pointer to the function used to obtain the column index based on the specified column name.|
| [OH_Cursor::getColumnName](#getcolumnname) | Pointer to the function used to obtain the column name based on the specified column index.|
| [OH_Cursor::getRowCount](#getrowcount) | Pointer to the function used to obtain the number of rows in the result set.|
| [OH_Cursor::goToNextRow](#gotonextrow) | Pointer to the function used to go to the next row of the result set.|
| [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**.|
| [OH_Cursor::getText](#gettext) | Pointer to the function used to obtain the value in the form of a string based on the specified column and the current row.|
| [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.|
| [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.|
| [OH_Cursor::getBlob](#getblob) | Pointer to the function used to obtain the value in the form of a byte array based on the specified column and the current row.|
| [OH_Cursor::isNull](#isnull-12) | Pointer to the function used to check whether the value in the specified column is null.|
| [OH_Cursor::close](#close) | Pointer to the function used to close a result set. |
| [OH_Predicates::id](#id-14) | Unique identifier of the **OH_Predicates** struct.|
| [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.|
| [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.|
| [OH_Predicates::beginWrap](#beginwrap) | Pointer to the function used to add a left parenthesis to the predicates.|
| [OH_Predicates::endWrap](#endwrap) | Pointer to the function used to add a right parenthesis to the predicates.|
| [OH_Predicates::orOperate](#oroperate) | Pointer to the function used to add the OR operator to the predicates.|
| [OH_Predicates::andOperate](#andoperate) | Pointer to the function used to add the AND operator to the predicates.|
| [OH_Predicates::isNull](#isnull-22) | Pointer to the function used to set a predicates object to match the field whose value is null.|
| [OH_Predicates::isNotNull](#isnotnull) | Pointer to the function used to set a predicates object to match the field whose value is not null.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [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.|
| [OH_Predicates::distinct](#distinct) | Pointer to the function used to set a predicates object to filter out duplicate records.|
| [OH_Predicates::limit](#limit) | Pointer to the function used to set a predicates object to specify the maximum number of records.|
| [OH_Predicates::offset](#offset) | Pointer to the function used to set a predicates object to specify the start position of the returned result.|
| [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.|
| [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.|
| [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.|
| [OH_Predicates::clear](#clear-12) | Pointer to the function used to clear a predicates instance.|
| [OH_Predicates::destroyPredicates](#destroypredicates) | Destroys an [OH_Predicates](_o_h___predicates.md) object and reclaims the memory occupied.|
| [OH_VObject::id](#id-24) | Unique identifier of the **OH_VObject** struct.|
| [OH_VObject::putInt64](#putint64-22) | Converts a single parameter or an array of the int64 type into a value of the [OH_VObject](_o_h___v_object.md) type.|
| [OH_VObject::putDouble](#putdouble) | Converts a single parameter or an array of the double type into a value of the [OH_VObject](_o_h___v_object.md) type.|
| [OH_VObject::putText](#puttext-22) | Converts a character array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type.|
| [OH_VObject::putTexts](#puttexts) | Converts a string array of the char type to a value of the [OH_VObject](_o_h___v_object.md) type.|
| [OH_VObject::destroyValueObject](#destroyvalueobject) | Destroys an [OH_VObject](_o_h___v_object.md) object and reclaims the memory occupied.|
| [OH_VBucket::id](#id-34) | Unique identifier of the **OH_VBucket** struct.|
| [OH_VBucket::capability](#capability) | Number of the KV pairs in the struct.|
| [OH_VBucket::putText](#puttext-12) | Puts a char value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
| [OH_VBucket::putInt64](#putint64-12) | Puts an int64_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
| [OH_VBucket::putReal](#putreal) | Puts a double value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
| [OH_VBucket::putBlob](#putblob) | Puts a const uint8_t value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
| [OH_VBucket::putNull](#putnull) | Puts a null value into the [OH_VBucket](_o_h___v_bucket.md) object in the given column.|
| [OH_VBucket::clear](#clear-22) | Clears an [OH_VBucket](_o_h___v_bucket.md) object.|
| [OH_VBucket::destroyValuesBucket](#destroyvaluesbucket) | Destroys an [OH_VBucket](_o_h___v_bucket.md) object and reclaims the memory occupied.|
| [OH_Rdb_Config::path](#path) | Path of the database file.|
| [OH_Rdb_Config::isEncrypt](#isencrypt) | Whether to encrypt the RDB store.|
| [OH_Rdb_Config::securityLevel](#securitylevel) | Set the RDB store security level [OH_Rdb_SecurityLevel](#oh_rdb_securitylevel).|
| [OH_Rdb_Store::id](#id-44) | Unique identifier of the **OH_Rdb_Store** struct.|
## Type Description
### OH_Cursor
```
typedef struct OH_Cursor OH_Cursor
```
**Description**
Indicates a result set.
It provides APIs to access the result set obtained by querying the RDB store.
### OH_Predicates
```
typedef struct OH_Predicates OH_Predicates
```
**Description**
Indicates a **predicates** object.
### OH_Rdb_ErrCode
```
typedef enum OH_Rdb_ErrCode OH_Rdb_ErrCode
```
**Description**
Indicates an error code.
### OH_VBucket
```
typedef struct OH_VBucket OH_VBucket
```
**Description**
Indicates the types of the key and value in a KV pair.
### OH_VObject
```
typedef struct OH_VObject OH_VObject
```
**Description**
Indicates the allowed data field types.
## Enum Description
### OH_ColumnType
```
enum OH_ColumnType
```
**Description**
Enumerates the field types in an RDB store.
| Value| Description|
| -------- | -------- |
| TYPE_NULL | NULL type.|
| TYPE_INT64 | INT64 type.|
| TYPE_REAL | REAL type.|
| TYPE_TEXT | TEXT type.|
| TYPE_BLOB | BLOB type.|
### OH_OrderType
```
enum OH_OrderType
```
**Description**
Enumerates the sorting types.
| Value| Description|
| -------- | -------- |
| ASC | Ascending order.|
| DESC | Descending order.|
### OH_Rdb_ErrCode
```
enum OH_Rdb_ErrCode
```
**Description**
Enumerates the error codes.
| Value| Description|
| -------- | -------- |
| RDB_ERR | Execution failed.|
| RDB_OK | Execution successful.|
| E_BASE | Base of the error code.|
| RDB_E_NOT_SUPPORTED | The RDB store does not have this capability.|
| RDB_E_ERROR | Common exception.|
| RDB_E_INVALID_ARGS | Invalid parameter.|
| RDB_E_CANNOT_UPDATE_READONLY | Failed to update data because the RDB store is read-only.|
| RDB_E_REMOVE_FILE | Failed to delete the file.|
| RDB_E_EMPTY_TABLE_NAME | The table name is empty.|
| RDB_E_EMPTY_VALUES_BUCKET | The content of the KV pair is empty.|
| RDB_E_EXECUTE_IN_STEP_QUERY | The SQL statement executed during the query is incorrect.|
| RDB_E_INVALID_COLUMN_INDEX | The column index is invalid.|
| RDB_E_INVALID_COLUMN_TYPE | The column type is invalid.|
| RDB_E_EMPTY_FILE_NAME | The file name is empty.|
| RDB_E_INVALID_FILE_PATH | The file path is invalid.|
| RDB_E_TRANSACTION_IN_EXECUTE | Failed to start the transaction.|
| RDB_E_INVALID_STATEMENT | Failed to precompile the SQL statement.|
| RDB_E_EXECUTE_WRITE_IN_READ_CONNECTION | Failed to perform a write operation in a read connection.|
| RDB_E_BEGIN_TRANSACTION_IN_READ_CONNECTION | Failed to start the transaction in a read connection.|
| RDB_E_NO_TRANSACTION_IN_SESSION | The transaction to start does not exist in the database session.|
| RDB_E_MORE_STEP_QUERY_IN_ONE_SESSION | Multiple queries are executed in a database session.|
| RDB_E_NO_ROW_IN_QUERY | The result set does not contain any record.|
| RDB_E_INVALID_BIND_ARGS_COUNT | The number of parameters bound in the SQL statement is invalid.|
| RDB_E_INVALID_OBJECT_TYPE | The object type is invalid.|
| RDB_E_INVALID_CONFLICT_FLAG | The conflict resolution type is invalid.|
| RDB_E_HAVING_CLAUSE_NOT_IN_GROUP_BY | The HAVING keyword can be used only after GROUP BY.|
| RDB_E_NOT_SUPPORTED_BY_STEP_RESULT_SET | The result set by step is not supported.|
| RDB_E_STEP_RESULT_SET_CROSS_THREADS | Failed to obtain the result set.|
| RDB_E_STEP_RESULT_QUERY_NOT_EXECUTED | The result set query statement is not executed.|
| RDB_E_STEP_RESULT_IS_AFTER_LAST | The cursor of the result set is already in the last row.|
| RDB_E_STEP_RESULT_QUERY_EXCEEDED | The number of result set query times exceeds the limit.|
| RDB_E_STATEMENT_NOT_PREPARED | The SQL statement is not precompiled.|
| RDB_E_EXECUTE_RESULT_INCORRECT | The database execution result is incorrect.|
| RDB_E_STEP_RESULT_CLOSED | The result set has been closed.|
| RDB_E_RELATIVE_PATH | The file path is a relative path.|
| RDB_E_EMPTY_NEW_ENCRYPT_KEY | The new encrypt key is empty.|
| RDB_E_CHANGE_UNENCRYPTED_TO_ENCRYPTED | The RDB store is non-encrypted and cannot be changed.|
| RDB_E_CHANGE_ENCRYPT_KEY_IN_BUSY | The database does not respond when the database key is updated.|
| RDB_E_STEP_STATEMENT_NOT_INIT | The precompiled SQL statement is not initialized.|
| RDB_E_NOT_SUPPORTED_ATTACH_IN_WAL_MODE | The WAL mode does not support the ATTACH operation.|
| RDB_E_CREATE_FOLDER_FAIL | Failed to create the folder.|
| RDB_E_SQLITE_SQL_BUILDER_NORMALIZE_FAIL | Failed to build the SQL statement.|
| RDB_E_STORE_SESSION_NOT_GIVE_CONNECTION_TEMPORARILY | The database session does not provide a connection.|
| RDB_E_STORE_SESSION_NO_CURRENT_TRANSACTION | The transaction does not exist in the database session.|
| RDB_E_NOT_SUPPORT | The current operation is not supported.|
| RDB_E_INVALID_PARCEL | The current PARCEL is invalid.|
| RDB_E_QUERY_IN_EXECUTE | Failed to execute query.|
| RDB_E_SET_PERSIST_WAL | Failed to set the persistence of the database file in WAL mode.|
| RDB_E_DB_NOT_EXIST | The database does not exist.|
| RDB_E_ARGS_READ_CON_OVERLOAD | The number of read connections to set is greater than the limit.|
| RDB_E_WAL_SIZE_OVER_LIMIT | The WAL log file size exceeds the default value.|
| RDB_E_CON_OVER_LIMIT | The number of database connections has reached the limit.|
### OH_Rdb_SecurityLevel
```
enum OH_Rdb_SecurityLevel
```
**Description**
Enumerates the RDB store security levels.
| Value| Description|
| -------- | -------- |
| S1 | The security level of the RDB store is low.<br>If data leakage occurs, minor impact will be caused.|
| S2 | The security level of the RDB store is medium.<br>If data leakage occurs, moderate impact will be caused.|
| S3 | The security level of the RDB store is high.<br>If data leakage occurs, major impact will be caused.|
| S4 | The security level of the RDB store is critical.<br>If data leakage occurs, critical impact will be caused.|
## Function Description
### OH_Rdb_Backup()
```
int OH_Rdb_Backup (OH_Rdb_Store * store, const char * databasePath )
```
**Description**
Backs up an RDB store in the specified directory.
**Parameters**
| Name| Description|
| -------- | -------- |
| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
| databasePath | Pointer to the destination directory in which the RDB store is backed up.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
**See**
[OH_Rdb_Store](_o_h___rdb___store.md).
### OH_Rdb_BeginTransaction()
```
int OH_Rdb_BeginTransaction (OH_Rdb_Store * store)
```
**Description**
Starts the transaction before executing the SQL statement.
**Parameters**
| Name| Description|
| -------- | -------- |
| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
**See**
[OH_Rdb_Store](_o_h___rdb___store.md).
### OH_Rdb_CloseStore()
```
int OH_Rdb_CloseStore (OH_Rdb_Store * store)
```
**Description**
Destroys an [OH_Rdb_Store](_o_h___rdb___store.md) object and reclaims the memory occupied.
**Parameters**
| Name| Description|
| -------- | -------- |
| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
**See**
[OH_Rdb_Store](_o_h___rdb___store.md).
### OH_Rdb_Commit()
```
int OH_Rdb_Commit (OH_Rdb_Store * store)
```
**Description**
Commits the executed SQL statements.
**Parameters**
| Name| Description|
| -------- | -------- |
| store | Pointer to the [OH_Rdb_Store](_o_h___rdb___store.md) instance.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
Converts a single parameter or an array of the double type into a value of the [OH_VObject](_o_h___v_object.md) type.
**Parameters**
| Name| Description|
| -------- | -------- |
| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
| value | Pointer to the data to covert.|
| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
Converts a single parameter or an array of the int64 type into a value of the [OH_VObject](_o_h___v_object.md) type.
**Parameters**
| Name| Description|
| -------- | -------- |
| valueObject | Pointer to the [OH_VObject](_o_h___v_object.md) instance.|
| value | Pointer to the data to covert.|
| count | If **value** points to a single parameter, **count** is **1**. If **value** points to an array, **count** specifies the length of the array.|
**Returns**
Returns **RDB_OK** is the operation is successful; returns an error code otherwise.
Provides APIs to access the result set obtained by querying the RDB store.
A result set is a set of results returned by **query()**.
**Since**
10
**Related Modules**
[RDB](_r_d_b.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OH_Cursor](_o_h___cursor.md) | Defines a result set.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_Cursor](_r_d_b.md#oh_cursor) | Indicates a result set.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_ColumnType](_r_d_b.md#oh_columntype) {<br>TYPE_NULL = 0, TYPE_INT64, TYPE_REAL, TYPE_TEXT,<br>TYPE_BLOB<br>} | Enumerates the field types in an RDB store.|
Provides APIs to manage a relational database (RDB) store.
**Since**
10
**Related Modules**
[RDB](_r_d_b.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OH_Rdb_Config](_o_h___rdb___config.md) | Defines the RDB store configuration.|
| [OH_Rdb_Store](_o_h___rdb___store.md) | Defines the RDB store type.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_Rdb_SecurityLevel](_r_d_b.md#oh_rdb_securitylevel) { S1 = 1, S2, S3, S4 } | Enumerates the RDB store security levels.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_Rdb_CreateValueObject](_r_d_b.md#oh_rdb_createvalueobject)(void) | Creates an [OH_VObject](_o_h___v_object.md) instance.|
| [OH_Rdb_CreateValuesBucket](_r_d_b.md#oh_rdb_createvaluesbucket)(void) | Creates an [OH_VBucket](_o_h___v_bucket.md) instance.|
| [OH_Rdb_CreatePredicates](_r_d_b.md#oh_rdb_createpredicates)(const char \*table) | Creates an [OH_Predicates](_o_h___predicates.md) instance.|
| [OH_Rdb_GetOrOpen](_r_d_b.md#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.|
| [OH_Rdb_CloseStore](_r_d_b.md#oh_rdb_closestore)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Destroys an [OH_Rdb_Store](_o_h___rdb___store.md) object and reclaims the memory occupied by the object.|
| [OH_Rdb_DeleteStore](_r_d_b.md#oh_rdb_deletestore)(const char \*path) | Deletes an RDB store with the specified database file configuration.|
| [OH_Rdb_Insert](_r_d_b.md#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.|
| [OH_Rdb_Update](_r_d_b.md#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.|
| [OH_Rdb_Delete](_r_d_b.md#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.|
| [OH_Rdb_Query](_r_d_b.md#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.|
| [OH_Rdb_Execute](_r_d_b.md#oh_rdb_execute)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, const char \*sql) | Executes the SQL statement that returns no value.|
| [OH_Rdb_ExecuteQuery](_r_d_b.md#oh_rdb_executequery)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, const char \*sql) | Queries data in an RDB store based on the SQL statements executed.|
| [OH_Rdb_BeginTransaction](_r_d_b.md#oh_rdb_begintransaction)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Starts the transaction before executing the SQL statements.|
| [OH_Rdb_RollBack](_r_d_b.md#oh_rdb_rollback)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Rolls back the SQL statements executed. |
| [OH_Rdb_Commit](_r_d_b.md#oh_rdb_commit)([OH_Rdb_Store](_o_h___rdb___store.md)\*store) | Commits the executed SQL statements.|
| [OH_Rdb_Backup](_r_d_b.md#oh_rdb_backup)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, const char \*databasePath) | Backs up the RDB store in the specified path.|
| [OH_Rdb_Restore](_r_d_b.md#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.|
| [OH_Rdb_GetVersion](_r_d_b.md#oh_rdb_getversion)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, int \*version) | Obtains the RDB store version.|
| [OH_Rdb_SetVersion](_r_d_b.md#oh_rdb_setversion)([OH_Rdb_Store](_o_h___rdb___store.md)\*store, int version) | Sets the RDB store version.|
Declares the error codes used for relational database (RDB) stores.
**Since**
10
**Related Modules**
[RDB](_r_d_b.md)
## Summary
### Enums
| Name| Description|
| -------- | -------- |
| [OH_Rdb_ErrCode](_r_d_b.md#oh_rdb_errcode) { RDB_ERR_INVALID_ARGS = -2, RDB_ERR = -1, RDB_ERR_OK = 0 } | Enumerates the RDB store error codes. |