1# oh_data_values.h 2 3## Overview 4 5Defines APIs and enums related to multiple data values. 6 7**File to include**: <database/rdb/oh_data_values.h> 8 9**Library**: libnative_rdb_ndk.z.so 10 11**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core 12 13**Since**: 18 14 15**Related module**: [RDB](capi-rdb.md) 16 17## Summary 18 19### Structs 20 21| Name | typedef Keyword | Description | 22| ---------------------------------------- | -------------- | ------------------------------------ | 23| [OH_Data_Values](capi-rdb-oh-data-values.md) | OH_Data_Values | Defines the **OH_Data_Values** struct.| 24 25### Functions 26 27| Name | Description | 28| ------------------------------------------------------------ | ------------------------------------------------------------ | 29| [OH_Data_Values *OH_Values_Create(void)](#oh_values_create) | Creates an [OH_Data_Values](capi-rdb-oh-data-values.md) instance to store multiple KV pairs.| 30| [int OH_Values_Destroy(OH_Data_Values *values)](#oh_values_destroy) | Destroys an [OH_Data_Values](capi-rdb-oh-data-values.md) instance. | 31| [int OH_Values_Put(OH_Data_Values *values, const OH_Data_Value *val)](#oh_values_put) | Adds data of the **OH_Data_Value** type to an **OH_Data_Values** instance. | 32| [int OH_Values_PutNull(OH_Data_Values *values)](#oh_values_putnull) | Adds empty data to an **OH_Data_Values** instance. | 33| [int OH_Values_PutInt(OH_Data_Values *values, int64_t val)](#oh_values_putint) | Adds an integer to an **OH_Data_Values** instance. | 34| [int OH_Values_PutReal(OH_Data_Values *values, double val)](#oh_values_putreal) | Adds REAL data to an **OH_Data_Values** instance. | 35| [int OH_Values_PutText(OH_Data_Values *values, const char *val)](#oh_values_puttext) | Adds a string to an **OH_Data_Values** instance. | 36| [int OH_Values_PutBlob(OH_Data_Values *values, const unsigned char *val, size_t length)](#oh_values_putblob) | Adds BLOB data to an **OH_Data_Values** instance. | 37| [int OH_Values_PutAsset(OH_Data_Values *values, const Data_Asset *val)](#oh_values_putasset) | Adds an asset to an **OH_Data_Values** instance. | 38| [int OH_Values_PutAssets(OH_Data_Values *values, const Data_Asset * const * val, size_t length)](#oh_values_putassets) | Adds assets to an **OH_Data_Values** instance. | 39| [int OH_Values_PutFloatVector(OH_Data_Values *values, const float *val, size_t length)](#oh_values_putfloatvector) | Adds a float array to an **OH_Data_Values** instance. | 40| [int OH_Values_PutUnlimitedInt(OH_Data_Values *values, int sign, const uint64_t *trueForm, size_t length)](#oh_values_putunlimitedint) | Adds an integer array of any length to an **OH_Data_Values** instance. | 41| [int OH_Values_Count(OH_Data_Values *values, size_t *count)](#oh_values_count) | Obtains the number of values in an **OH_Data_Values** instance. | 42| [int OH_Values_GetType(OH_Data_Values *values, int index, OH_ColumnType *type)](#oh_values_gettype) | Obtains the type of a value in an **OH_Data_Values** instance. | 43| [int OH_Values_Get(OH_Data_Values *values, int index, OH_Data_Value **val)](#oh_values_get) | Obtains data of the **OH_Data_Value** type. | 44| [int OH_Values_IsNull(OH_Data_Values *values, int index, bool *val)](#oh_values_isnull) | Checks whether a value is null. | 45| [int OH_Values_GetInt(OH_Data_Values *values, int index, int64_t *val)](#oh_values_getint) | Obtains the integer from an **OH_Data_Values** instance. | 46| [int OH_Values_GetReal(OH_Data_Values *values, int index, double *val)](#oh_values_getreal) | Obtains the REAL data from an **OH_Data_Values** instance. | 47| [int OH_Values_GetText(OH_Data_Values *values, int index, const char **val)](#oh_values_gettext) | Obtains the string from an **OH_Data_Values** instance. | 48| [int OH_Values_GetBlob(OH_Data_Values *values, int index, const uint8_t **val, size_t *length)](#oh_values_getblob) | Obtains the BLOB data from an **OH_Data_Values** instance. | 49| [int OH_Values_GetAsset(OH_Data_Values *values, int index, Data_Asset *val)](#oh_values_getasset) | Obtains the asset from an **OH_Data_Values** instance. | 50| [int OH_Values_GetAssetsCount(OH_Data_Values *values, int index, size_t *length)](#oh_values_getassetscount) | Obtains the length of the asset in an **OH_Data_Values** instance. | 51| [int OH_Values_GetAssets(OH_Data_Values *values, int index, Data_Asset **val, size_t inLen, size_t *outLen)](#oh_values_getassets) | Obtains the assets from an **OH_Data_Values** instance. | 52| [int OH_Values_GetFloatVectorCount(OH_Data_Values *values, int index, size_t *length)](#oh_values_getfloatvectorcount) | Obtains the length of the float array in an **OH_Data_Values** instance. | 53| [int OH_Values_GetFloatVector(OH_Data_Values *values, int index, float *val, size_t inLen, size_t *outLen)](#oh_values_getfloatvector) | Obtains the float array from an **OH_Data_Values** instance. | 54| [int OH_Values_GetUnlimitedIntBand(OH_Data_Values *values, int index, size_t *length)](#oh_values_getunlimitedintband) | Obtains the length of the unlimited integer from an **OH_Data_Values** instance. | 55| [int OH_Values_GetUnlimitedInt(OH_Data_Values *values, int index, int *sign, uint64_t *trueForm, size_t inLen,size_t *outLen)](#oh_values_getunlimitedint) | Obtains the unlimited integer from an **OH_Data_Values** instance. | 56 57## Function Description 58 59### OH_Values_Create() 60 61``` 62OH_Data_Values *OH_Values_Create(void) 63``` 64 65**Description** 66 67Creates an [OH_Data_Values](capi-rdb-oh-data-values.md) instance to store multiple KV pairs. 68 69**Since**: 18 70 71**Returns** 72 73| Type | Description | 74| ---------------------------------------- | ------------------------------------------------------------ | 75| [OH_Data_Values](capi-rdb-oh-data-values.md) | Returns a pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance created if the operation is successful; returns **nullptr** otherwise.<br>Use [OH_Values_Destroy](capi-oh-data-values-h.md#oh_values_destroy) to release the memory in time.| 76 77### OH_Values_Destroy() 78 79``` 80int OH_Values_Destroy(OH_Data_Values *values) 81``` 82 83**Description** 84 85Destroys an [OH_Data_Values](capi-rdb-oh-data-values.md) instance. 86 87**Since**: 18 88 89 90**Parameters** 91 92| Name | Description | 93| ------------------------------------------------ | ------------------------------------------------------------ | 94| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 95 96**Returns** 97 98| Type| Description | 99| ---- | ------------------------------------------------------------ | 100| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 101 102### OH_Values_Put() 103 104``` 105int OH_Values_Put(OH_Data_Values *values, const OH_Data_Value *val) 106``` 107 108**Description** 109 110Adds data of the **OH_Data_Value** type to an **OH_Data_Values** instance. 111 112**Since**: 18 113 114 115**Parameters** 116 117| Name | Description | 118| ------------------------------------------------- | ------------------------------------------------------------ | 119| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 120| const [OH_Data_Value](capi-rdb-oh-data-value.md) *val | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance. | 121 122**Returns** 123 124| Type| Description | 125| ---- | ------------------------------------------------------------ | 126| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 127 128### OH_Values_PutNull() 129 130``` 131int OH_Values_PutNull(OH_Data_Values *values) 132``` 133 134**Description** 135 136Adds empty data to an **OH_Data_Values** instance. 137 138**Since**: 18 139 140 141**Parameters** 142 143| Name | Description | 144| ------------------------------------------------ | ------------------------------------------------------------ | 145| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 146 147**Returns** 148 149| Type| Description | 150| ---- | ------------------------------------------------------------ | 151| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 152 153### OH_Values_PutInt() 154 155``` 156int OH_Values_PutInt(OH_Data_Values *values, int64_t val) 157``` 158 159**Description** 160 161Adds an integer to an **OH_Data_Values** instance. 162 163**Since**: 18 164 165 166**Parameters** 167 168| Name | Description | 169| ------------------------------------------------ | ------------------------------------------------------------ | 170| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 171| int64_t val | Pointer to the integer to add. | 172 173**Returns** 174 175| Type| Description | 176| ---- | ------------------------------------------------------------ | 177| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 178 179### OH_Values_PutReal() 180 181``` 182int OH_Values_PutReal(OH_Data_Values *values, double val) 183``` 184 185**Description** 186 187Adds REAL data to an **OH_Data_Values** instance. 188 189**Since**: 18 190 191 192**Parameters** 193 194| Name | Description | 195| ------------------------------------------------ | ------------------------------------------------------------ | 196| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 197| double val | Pointer to the REAL data to add. | 198 199**Returns** 200 201| Type| Description | 202| ---- | ------------------------------------------------------------ | 203| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 204 205### OH_Values_PutText() 206 207``` 208int OH_Values_PutText(OH_Data_Values *values, const char *val) 209``` 210 211**Description** 212 213Adds a string to an **OH_Data_Values** instance. 214 215**Since**: 18 216 217 218**Parameters** 219 220| Name | Description | 221| ------------------------------------------------ | ------------------------------------------------------------ | 222| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 223| const char *val | Pointer to the string to add. | 224 225**Returns** 226 227| Type| Description | 228| ---- | ------------------------------------------------------------ | 229| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 230 231### OH_Values_PutBlob() 232 233``` 234int OH_Values_PutBlob(OH_Data_Values *values, const unsigned char *val, size_t length) 235``` 236 237**Description** 238 239Adds BLOB data to an **OH_Data_Values** instance. 240 241**Since**: 18 242 243 244**Parameters** 245 246| Name | Description | 247| ------------------------------------------------ | ------------------------------------------------------------ | 248| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 249| const unsigned char *val | Pointer to the BLOB data to add. | 250| size_t length | Length of the BLOB data to add. | 251 252**Returns** 253 254| Type| Description | 255| ---- | ------------------------------------------------------------ | 256| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 257 258### OH_Values_PutAsset() 259 260``` 261int OH_Values_PutAsset(OH_Data_Values *values, const Data_Asset *val) 262``` 263 264**Description** 265 266Adds an asset to an **OH_Data_Values** instance. 267 268**Since**: 18 269 270 271**Parameters** 272 273| Name | Description | 274| ------------------------------------------------ | ------------------------------------------------------------ | 275| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 276| const [Data_Asset](capi-rdb-data-asset.md) *val | Pointer to the [Data_Asset](capi-rdb-data-asset.md) instance. | 277 278**Returns** 279 280| Type| Description | 281| ---- | ------------------------------------------------------------ | 282| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 283 284### OH_Values_PutAssets() 285 286``` 287int OH_Values_PutAssets(OH_Data_Values *values, const Data_Asset * const * val, size_t length) 288``` 289 290**Description** 291 292Adds assets to an **OH_Data_Values** instance. 293 294**Since**: 18 295 296 297**Parameters** 298 299| Name | Description | 300| ---------------------------------------------------- | ------------------------------------------------------------ | 301| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 302| const [Data_Asset](capi-rdb-data-asset.md) * const * val | Pointer to the [Data_Asset](capi-rdb-data-asset.md) instance. | 303| size_t length | Number of elements in the [Data_Asset](capi-rdb-data-asset.md) object to add.| 304 305**Returns** 306 307| Type| Description | 308| ---- | ------------------------------------------------------------ | 309| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 310 311### OH_Values_PutFloatVector() 312 313``` 314int OH_Values_PutFloatVector(OH_Data_Values *values, const float *val, size_t length) 315``` 316 317**Description** 318 319Adds a float array to an **OH_Data_Values** instance. 320 321**Since**: 18 322 323 324**Parameters** 325 326| Name | Description | 327| ------------------------------------------------ | ------------------------------------------------------------ | 328| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 329| const float *val | Pointer to the float array to add. | 330| size_t length | Length of the float array to add. | 331 332**Returns** 333 334| Type| Description | 335| ---- | ------------------------------------------------------------ | 336| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 337 338### OH_Values_PutUnlimitedInt() 339 340``` 341int OH_Values_PutUnlimitedInt(OH_Data_Values *values, int sign, const uint64_t *trueForm, size_t length) 342``` 343 344**Description** 345 346Adds an integer array of any length to an **OH_Data_Values** instance. 347 348**Since**: 18 349 350 351**Parameters** 352 353| Name | Description | 354| ------------------------------------------------ | ------------------------------------------------------------ | 355| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 356| int sign | Sign notation of the integer array to add. The value **0** indicates a positive integer, and the value **1** indicates a negative integer. | 357| const uint64_t *trueForm | Pointer to the integer array to add. | 358| size_t length | Length of the integer array to add. | 359 360**Returns** 361 362| Type| Description | 363| ---- | ------------------------------------------------------------ | 364| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 365 366### OH_Values_Count() 367 368``` 369int OH_Values_Count(OH_Data_Values *values, size_t *count) 370``` 371 372**Description** 373 374Obtains the number of records in an **OH_Data_Values** instance. 375 376**Since**: 18 377 378 379**Parameters** 380 381| Name | Description | 382| ------------------------------------------------ | ------------------------------------------------------------ | 383| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 384| size_t *count | Pointer to the number of values contained in **values** obtained. | 385 386**Returns** 387 388| Type| Description | 389| ---- | ------------------------------------------------------------ | 390| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 391 392### OH_Values_GetType() 393 394``` 395int OH_Values_GetType(OH_Data_Values *values, int index, OH_ColumnType *type) 396``` 397 398**Description** 399 400Obtains the data type. 401 402**Since**: 18 403 404 405**Parameters** 406 407| Name | Description | 408| ------------------------------------------------------------ | ------------------------------------------------------------ | 409| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 410| int index | Index of the value to check, which starts from 0 in **values**. | 411| [OH_ColumnType](capi-oh-data-value-h.md#oh_columntype) *type | Pointer to the data type obtained. | 412 413**Returns** 414 415| Type| Description | 416| ---- | ------------------------------------------------------------ | 417| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 418 419### OH_Values_Get() 420 421``` 422int OH_Values_Get(OH_Data_Values *values, int index, OH_Data_Value **val) 423``` 424 425**Description** 426 427Obtains data of the **OH_Data_Value** type. 428 429**Since**: 18 430 431 432**Parameters** 433 434| Name | Description | 435| ------------------------------------------------ | ------------------------------------------------------------ | 436| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 437| int index | Index of the value to check, which starts from 0 in **values**. | 438| [OH_Data_Value](capi-rdb-oh-data-value.md) **val | Double pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.<br>You do not need to apply for or release memory for it.| 439 440**Returns** 441 442| Type| Description | 443| ---- | ------------------------------------------------------------ | 444| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 445 446### OH_Values_IsNull() 447 448``` 449int OH_Values_IsNull(OH_Data_Values *values, int index, bool *val) 450``` 451 452**Description** 453 454Checks whether a value is null. 455 456**Since**: 18 457 458 459**Parameters** 460 461| Name | Description | 462| ------------------------------------------------ | ------------------------------------------------------------ | 463| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 464| int index | Index of the value to check, which starts from 0 in **values**. | 465| bool *val | Pointer to the check result. The value **true** means the value is null, and the value **false** means the opposite. | 466 467**Returns** 468 469| Type| Description | 470| ---- | ------------------------------------------------------------ | 471| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.| 472 473### OH_Values_GetInt() 474 475``` 476int OH_Values_GetInt(OH_Data_Values *values, int index, int64_t *val) 477``` 478 479**Description** 480 481Obtains the integer from an **OH_Data_Values** instance. 482 483**Since**: 18 484 485 486**Parameters** 487 488| Name | Description | 489| ------------------------------------------------ | ------------------------------------------------------------ | 490| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 491| int index | Index of the value to check, which starts from 0 in **values**. | 492| int64_t *val | Pointer to the integer data obtained. | 493 494**Returns** 495 496| Type| Description | 497| ---- | ------------------------------------------------------------ | 498| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 499 500### OH_Values_GetReal() 501 502``` 503int OH_Values_GetReal(OH_Data_Values *values, int index, double *val) 504``` 505 506**Description** 507 508Obtains the REAL data from an **OH_Data_Values** instance. 509 510**Since**: 18 511 512 513**Parameters** 514 515| Name | Description | 516| ------------------------------------------------ | ------------------------------------------------------------ | 517| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 518| int index | Index of the value to check, which starts from 0 in **values**. | 519| double *val | Pointer to the REAL data obtained. | 520 521**Returns** 522 523| Type| Description | 524| ---- | ------------------------------------------------------------ | 525| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 526 527### OH_Values_GetText() 528 529``` 530int OH_Values_GetText(OH_Data_Values *values, int index, const char **val) 531``` 532 533**Description** 534 535Obtains the string from an **OH_Data_Values** instance. 536 537**Since**: 18 538 539 540**Parameters** 541 542| Name | Description | 543| ------------------------------------------------ | ------------------------------------------------------------ | 544| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 545| int index | Index of the value to check, which starts from 0 in **values**. | 546| const char **val | Pointer to the string obtained.<br>You do not need to apply for or release memory for it.<br>The lifecycle of **val** complies with the value of **index** in **values**.| 547 548**Returns** 549 550| Type| Description | 551| ---- | ------------------------------------------------------------ | 552| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 553 554### OH_Values_GetBlob() 555 556``` 557int OH_Values_GetBlob(OH_Data_Values *values, int index, const uint8_t **val, size_t *length) 558``` 559 560**Description** 561 562Obtains the BLOB data from an **OH_Data_Values** instance. 563 564**Since**: 18 565 566 567**Parameters** 568 569| Name | Description | 570| ------------------------------------------------ | ------------------------------------------------------------ | 571| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 572| int index | Index of the value to check, which starts from 0 in **values**. | 573| const uint8_t **val | Double pointer to the BLOB data obtained.<br>You do not need to apply for or release memory for it.<br>The lifecycle of **val** complies with the value of **index** in **values**.| 574| size_t *length | Pointer to the length of the BLOB data obtained. | 575 576**Returns** 577 578| Type| Description | 579| ---- | ------------------------------------------------------------ | 580| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 581 582### OH_Values_GetAsset() 583 584``` 585int OH_Values_GetAsset(OH_Data_Values *values, int index, Data_Asset *val) 586``` 587 588**Description** 589 590Obtains the asset from an **OH_Data_Values** instance. 591 592**Since**: 18 593 594 595**Parameters** 596 597| Name | Description | 598| ------------------------------------------------ | ------------------------------------------------------------ | 599| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 600| int index | Index of the value to check, which starts from 0 in **values**. | 601| [Data_Asset](capi-rdb-data-asset.md) *val | Pointer to the [Data_Asset](capi-rdb-data-asset.md) instance.<br>You need to apply for memory for it.<br>This function is used to fill in data only. Otherwise, the execution fails.| 602 603**Returns** 604 605| Type| Description | 606| ---- | ------------------------------------------------------------ | 607| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 608 609### OH_Values_GetAssetsCount() 610 611``` 612int OH_Values_GetAssetsCount(OH_Data_Values *values, int index, size_t *length) 613``` 614 615**Description** 616 617Obtains the length of the asset in an **OH_Data_Values** instance. 618 619**Since**: 18 620 621 622**Parameters** 623 624| Name | Description | 625| ------------------------------------------------ | ------------------------------------------------------------ | 626| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance. Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 627| int index | Index of the value to check, which starts from 0 in **values**. | 628| size_t *length | Pointer to the length of the ASSETS data obtained. | 629 630**Returns** 631 632| Type| Description | 633| ---- | ------------------------------------------------------------ | 634| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 635 636### OH_Values_GetAssets() 637 638``` 639int OH_Values_GetAssets(OH_Data_Values *values, int index, Data_Asset **val, size_t inLen, size_t *outLen) 640``` 641 642**Description** 643 644Obtains the assets from an **OH_Data_Values** instance. 645 646**Since**: 18 647 648 649**Parameters** 650 651| Name | Description | 652| ------------------------------------------------ | ------------------------------------------------------------ | 653| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 654| int index | Index of the value to check, which starts from 0 in **values**. | 655| [Data_Asset](capi-rdb-data-asset.md) **val | Double pointer to the [Data_Asset](capi-rdb-data-asset.md) instance.<br>You need to apply for memory for it.<br>This function is used to fill in data only. Otherwise, the execution fails.| 656| size_t inLen | Size of **val**, which can be obtained using [OH_Values_GetAssetsCount](capi-oh-data-values-h.md#oh_values_getassetscount).| 657| size_t *outLen | Pointer to the actual length of the data obtained. | 658 659**Returns** 660 661| Type| Description | 662| ---- | ------------------------------------------------------------ | 663| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 664 665### OH_Values_GetFloatVectorCount() 666 667``` 668int OH_Values_GetFloatVectorCount(OH_Data_Values *values, int index, size_t *length) 669``` 670 671**Description** 672 673Obtains the length of the float array in an **OH_Data_Values** instance. 674 675**Since**: 18 676 677 678**Parameters** 679 680| Name | Description | 681| ------------------------------------------------ | ------------------------------------------------------------ | 682| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 683| int index | Index of the value to check, which starts from 0 in **values**. | 684| size_t *length | Pointer to the length of the float data obtained. | 685 686**Returns** 687 688| Type| Description | 689| ---- | ------------------------------------------------------------ | 690| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 691 692### OH_Values_GetFloatVector() 693 694``` 695int OH_Values_GetFloatVector(OH_Data_Values *values, int index, float *val, size_t inLen, size_t *outLen) 696``` 697 698**Description** 699 700Obtains the float array from an **OH_Data_Values** instance. 701 702**Since**: 18 703 704 705**Parameters** 706 707| Name | Description | 708| ------------------------------------------------ | ------------------------------------------------------------ | 709| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 710| int index | Index of the value to check, which starts from 0 in **values**. | 711| float *val | Pointer to the float array obtained.<br>You need to apply for memory for it.<br>This function is used to fill in data only. Otherwise, the execution fails.| 712| size_t inLen | Size of **val**, which can be obtained using [OH_Values_GetFloatVectorCount](capi-oh-data-values-h.md#oh_values_getfloatvectorcount).| 713| size_t *outLen | Pointer to the actual length of the data obtained. | 714 715**Returns** 716 717| Type| Description | 718| ---- | ------------------------------------------------------------ | 719| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 720 721### OH_Values_GetUnlimitedIntBand() 722 723``` 724int OH_Values_GetUnlimitedIntBand(OH_Data_Values *values, int index, size_t *length) 725``` 726 727**Description** 728 729Obtains the length of the unlimited integer from an **OH_Data_Values** instance. 730 731**Since**: 18 732 733 734**Parameters** 735 736| Name | Description | 737| ------------------------------------------------ | ------------------------------------------------------------ | 738| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 739| int index | Index of the value to check, which starts from 0 in **values**. | 740| size_t *length | Pointer to the length of the integer obtained. | 741 742**Returns** 743 744| Type| Description | 745| ---- | ------------------------------------------------------------ | 746| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 747 748### OH_Values_GetUnlimitedInt() 749 750``` 751int OH_Values_GetUnlimitedInt(OH_Data_Values *values, int index, int *sign, uint64_t *trueForm, size_t inLen,size_t *outLen) 752``` 753 754**Description** 755 756Obtains the unlimited integer from an **OH_Data_Values** instance. 757 758**Since**: 18 759 760 761**Parameters** 762 763| Name | Description | 764| ------------------------------------------------ | ------------------------------------------------------------ | 765| [OH_Data_Values](capi-rdb-oh-data-values.md) *values | Pointer to the [OH_Data_Values](capi-rdb-oh-data-values.md) instance.| 766| int index | Index of the value to check, which starts from 0 in **values**. | 767| int *sign | Pointer to the sign notation of the integer obtained. The value **0** indicates a positive integer, and the value **1** indicates a negative integer. | 768| uint64_t *trueForm | Pointer to the integer array obtained.<br>You need to apply for memory for it.<br>This function is used to fill in data only. Otherwise, the execution fails.| 769| size_t inLen | **trueForm** length, which can be obtained using [OH_Values_GetUnlimitedIntBand](capi-oh-data-values-h.md#oh_values_getunlimitedintband).| 770| size_t *outLen | Pointer to the actual length of the data obtained. | 771 772**Returns** 773 774| Type| Description | 775| ---- | ------------------------------------------------------------ | 776| int | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates invalid parameters are specified.<br>**RDB_E_DATA_TYPE_NULL** indicates the stored data is empty.<br>**RDB_E_TYPE_MISMATCH** indicates the data types do not match.| 777