• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# oh_data_value.h
2
3## Overview
4
5Defines APIs and enums related to a single data value.<br>Since API version 18, **OH_ColumnType** is moved from **oh_cursor.h** to this file. This type is supported in versions earlier than API version 18 and can be used in all versions.
6
7**File to include**: <database/rdb/oh_data_value.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_Value](capi-rdb-oh-data-value.md) | OH_Data_Value | Defines the [OH_Data_Value](capi-rdb-oh-data-value.md) struct.|
24
25### Enums
26
27| Name                           | typedef Keyword| Description          |
28| ------------------------------- | ------------- | -------------- |
29| [OH_ColumnType](#oh_columntype) | OH_ColumnType | Enumerates the column types.|
30
31### Functions
32
33| Name                                                        | Description                                                        |
34| ------------------------------------------------------------ | ------------------------------------------------------------ |
35| [OH_Data_Value *OH_Value_Create(void)](#oh_value_create)     | Creates an [OH_Data_Values](capi-rdb-oh-data-values.md) instance to store a single KV pair.|
36| [int OH_Value_Destroy(OH_Data_Value *value)](#oh_value_destroy) | Destroys an [OH_Data_Value](capi-rdb-oh-data-value.md) instance.            |
37| [int OH_Value_PutNull(OH_Data_Value *value)](#oh_value_putnull) | Adds empty data to an **OH_Data_Value** instance.                                                |
38| [int OH_Value_PutInt(OH_Data_Value *value, int64_t val)](#oh_value_putint) | Adds an integer to an **OH_Data_Value** instance.                                              |
39| [int OH_Value_PutReal(OH_Data_Value *value, double val)](#oh_value_putreal) | Adds REAL data to an **OH_Data_Value** instance.                                          |
40| [int OH_Value_PutText(OH_Data_Value *value, const char *val)](#oh_value_puttext) | Adds a string to an **OH_Data_Value** instance.                                        |
41| [int OH_Value_PutBlob(OH_Data_Value *value, const unsigned char *val, size_t length)](#oh_value_putblob) | Adds BLOB data to an **OH_Data_Value** instance.                                          |
42| [int OH_Value_PutAsset(OH_Data_Value *value, const Data_Asset *val)](#oh_value_putasset) | Adds an asset to an **OH_Data_Value** instance.                                         |
43| [int OH_Value_PutAssets(OH_Data_Value *value, const Data_Asset * const * val, size_t length)](#oh_value_putassets) | Adds assets to an **OH_Data_Value** instance.                                        |
44| [int OH_Value_PutFloatVector(OH_Data_Value *value, const float *val, size_t length)](#oh_value_putfloatvector) | Adds a float array to an **OH_Data_Value** instance.                                     |
45| [int OH_Value_PutUnlimitedInt(OH_Data_Value *value, int sign, const uint64_t *trueForm, size_t length)](#oh_value_putunlimitedint) | Adds an integer array of any length to an **OH_Data_Value** instance.                                |
46| [int OH_Value_GetType(OH_Data_Value *value, OH_ColumnType *type)](#oh_value_gettype) | Obtains the type of a value in an **OH_Data_Values** instance.                                              |
47| [int OH_Value_IsNull(OH_Data_Value *value, bool *val)](#oh_value_isnull) | Checks whether a value is null.                                          |
48| [int OH_Value_GetInt(OH_Data_Value *value, int64_t *val)](#oh_value_getint) | Obtains the integer from an **OH_Data_Value** instance.                                              |
49| [int OH_Value_GetReal(OH_Data_Value *value, double *val)](#oh_value_getreal) | Obtains the REAL data from an **OH_Data_Value** instance.                                          |
50| [int OH_Value_GetText(OH_Data_Value *value, const char **val)](#oh_value_gettext) | Obtains the string from an **OH_Data_Value** instance.                                        |
51| [int OH_Value_GetBlob(OH_Data_Value *value, const uint8_t **val, size_t *length)](#oh_value_getblob) | Obtains the BLOB data from an **OH_Data_Value** instance.                                          |
52| [int OH_Value_GetAsset(OH_Data_Value *value, Data_Asset *val)](#oh_value_getasset) | Obtains the asset from an **OH_Data_Value** instance.                                         |
53| [int OH_Value_GetAssetsCount(OH_Data_Value *value, size_t *length)](#oh_value_getassetscount) | Obtains the length of the assets in an **OH_Data_Value** instance.                                  |
54| [int OH_Value_GetAssets(OH_Data_Value *value, Data_Asset **val, size_t inLen, size_t *outLen)](#oh_value_getassets) | Obtains the assets from an **OH_Data_Value** instance.                                        |
55| [int OH_Value_GetFloatVectorCount(OH_Data_Value *value, size_t *length)](#oh_value_getfloatvectorcount) | Obtains the length of the float array in an **OH_Data_Values** instance.                               |
56| [int OH_Value_GetFloatVector(OH_Data_Value *value, float *val, size_t inLen, size_t *outLen)](#oh_value_getfloatvector) | Obtains the float array from an **OH_Data_Values** instance.                                     |
57| [int OH_Value_GetUnlimitedIntBand(OH_Data_Value *value, size_t *length)](#oh_value_getunlimitedintband) | Obtains the length of the unlimited integer from an **OH_Data_Value** instance.                              |
58| [int OH_Value_GetUnlimitedInt(OH_Data_Value *value, int *sign, uint64_t *trueForm, size_t inLen, size_t *outLen)](#oh_value_getunlimitedint) | Obtains the unlimited integer from an **OH_Data_Value** instance.                                    |
59
60## Enum Description
61
62### OH_ColumnType
63
64```
65enum OH_ColumnType
66```
67
68**Description**
69
70Enumerates the column types.
71
72**Since**: 10
73
74| Enum Item            | Description                                                     |
75| ------------------ | --------------------------------------------------------- |
76| TYPE_NULL = 0      | NULL.                                           |
77| TYPE_INT64         | INT64.                                      |
78| TYPE_REAL          | REAL.                                       |
79| TYPE_TEXT          | TEXT.                                       |
80| TYPE_BLOB          | BLOB.                                       |
81| TYPE_ASSET         | ASSET (asset attachment).<br>**Since**: 11     |
82| TYPE_ASSETS        | ASSETS (multiple asset attachments).<br>**Since**: 11|
83| TYPE_FLOAT_VECTOR  | FLOAT VECTOR.<br>**Since**: 18          |
84| TYPE_UNLIMITED_INT | Number longer than 64 digits.<br>**Since**: 18    |
85
86
87## Function Description
88
89### OH_Value_Create()
90
91```
92OH_Data_Value *OH_Value_Create(void)
93```
94
95**Description**
96
97Creates an [OH_Data_Values](capi-rdb-oh-data-values.md) instance to store a single KV pair.
98
99**Since**: 18
100
101**Returns**
102
103| Type                                  | Description                                                        |
104| -------------------------------------- | ------------------------------------------------------------ |
105| [OH_Data_Value](capi-rdb-oh-data-value.md) | Returns a pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance if the operation is successful; returns **nullptr** otherwise.<br>Use [OH_Value_Destroy](capi-oh-data-value-h.md#oh_value_destroy) to release the memory in time.|
106
107### OH_Value_Destroy()
108
109```
110int OH_Value_Destroy(OH_Data_Value *value)
111```
112
113**Description**
114
115Destroys an [OH_Data_Value](capi-rdb-oh-data-value.md) instance.
116
117**Since**: 18
118
119
120**Parameters**
121
122| Name                                       | Description                                                      |
123| --------------------------------------------- | ---------------------------------------------------------- |
124| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
125
126**Returns**
127
128| Type| Description                                                        |
129| ---- | ------------------------------------------------------------ |
130| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
131
132### OH_Value_PutNull()
133
134```
135int OH_Value_PutNull(OH_Data_Value *value)
136```
137
138**Description**
139
140Adds empty data to an **OH_Data_Value** instance.
141
142**Since**: 18
143
144
145**Parameters**
146
147| Name                                       | Description                                                      |
148| --------------------------------------------- | ---------------------------------------------------------- |
149| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
150
151**Returns**
152
153| Type| Description                                                        |
154| ---- | ------------------------------------------------------------ |
155| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
156
157### OH_Value_PutInt()
158
159```
160int OH_Value_PutInt(OH_Data_Value *value, int64_t val)
161```
162
163**Description**
164
165Adds an integer to an **OH_Data_Value** instance.
166
167**Since**: 18
168
169
170**Parameters**
171
172| Name                                       | Description                                                      |
173| --------------------------------------------- | ---------------------------------------------------------- |
174| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
175| int64_t val                                   | Integer to add.                                            |
176
177**Returns**
178
179| Type| Description                                                        |
180| ---- | ------------------------------------------------------------ |
181| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
182
183### OH_Value_PutReal()
184
185```
186int OH_Value_PutReal(OH_Data_Value *value, double val)
187```
188
189**Description**
190
191Adds REAL data to an **OH_Data_Value** instance.
192
193**Since**: 18
194
195
196**Parameters**
197
198| Name                                       | Description                                                      |
199| --------------------------------------------- | ---------------------------------------------------------- |
200| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
201| double val                                    | REAL data to add.                                        |
202
203**Returns**
204
205| Type| Description                                                        |
206| ---- | ------------------------------------------------------------ |
207| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
208
209### OH_Value_PutText()
210
211```
212int OH_Value_PutText(OH_Data_Value *value, const char *val)
213```
214
215**Description**
216
217Adds a string to an **OH_Data_Value** instance.
218
219**Since**: 18
220
221
222**Parameters**
223
224| Name                                       | Description                                                      |
225| --------------------------------------------- | ---------------------------------------------------------- |
226| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
227| const char *val                               | Pointer to the string to add.                                      |
228
229**Returns**
230
231| Type| Description                                                        |
232| ---- | ------------------------------------------------------------ |
233| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
234
235### OH_Value_PutBlob()
236
237```
238int OH_Value_PutBlob(OH_Data_Value *value, const unsigned char *val, size_t length)
239```
240
241**Description**
242
243Adds BLOB data to an **OH_Data_Value** instance.
244
245**Since**: 18
246
247
248**Parameters**
249
250| Name                                       | Description                                                      |
251| --------------------------------------------- | ---------------------------------------------------------- |
252| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
253| const unsigned char *val                      | Pointer to the BLOB data to add.                                        |
254| size_t length                                 | Length of the BLOB data to add.    |
255
256**Returns**
257
258| Type| Description                                                        |
259| ---- | ------------------------------------------------------------ |
260| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
261
262### OH_Value_PutAsset()
263
264```
265int OH_Value_PutAsset(OH_Data_Value *value, const Data_Asset *val)
266```
267
268**Description**
269
270Adds an asset to an **OH_Data_Value** instance.
271
272**Since**: 18
273
274
275**Parameters**
276
277| Name                                       | Description                                                      |
278| --------------------------------------------- | ---------------------------------------------------------- |
279| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
280| const [Data_Asset](capi-rdb-data-asset.md) *val   | Pointer to the [Data_Asset](capi-rdb-data-asset.md) instance.      |
281
282**Returns**
283
284| Type| Description                                                        |
285| ---- | ------------------------------------------------------------ |
286| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
287
288### OH_Value_PutAssets()
289
290```
291int OH_Value_PutAssets(OH_Data_Value *value, const Data_Asset * const * val, size_t length)
292```
293
294**Description**
295
296Adds assets to an **OH_Data_Value** instance.
297
298**Since**: 18
299
300
301**Parameters**
302
303| Name                                              | Description                                                        |
304| ---------------------------------------------------- | ------------------------------------------------------------ |
305| [OH_Data_Value](capi-rdb-oh-data-value.md) *value        | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
306| const [Data_Asset](capi-rdb-data-asset.md) * const * val | Pointer to the [Data_Asset](capi-rdb-data-asset.md) instance.        |
307| size_t length                                        | Number of elements in the [Data_Asset](capi-rdb-data-asset.md) object to add.|
308
309**Returns**
310
311| Type| Description                                                        |
312| ---- | ------------------------------------------------------------ |
313| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
314
315### OH_Value_PutFloatVector()
316
317```
318int OH_Value_PutFloatVector(OH_Data_Value *value, const float *val, size_t length)
319```
320
321**Description**
322
323Adds a float array to an **OH_Data_Value** instance.
324
325**Since**: 18
326
327
328**Parameters**
329
330| Name                                       | Description                                                      |
331| --------------------------------------------- | ---------------------------------------------------------- |
332| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
333| const float *val                              | Pointer to the float array to add.                             |
334| size_t length                                 | Length of the float array to add.   |
335
336**Returns**
337
338| Type| Description                                                        |
339| ---- | ------------------------------------------------------------ |
340| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
341
342### OH_Value_PutUnlimitedInt()
343
344```
345int OH_Value_PutUnlimitedInt(OH_Data_Value *value, int sign, const uint64_t *trueForm, size_t length)
346```
347
348**Description**
349
350Adds an integer array of any length to an **OH_Data_Value** instance.
351
352**Since**: 18
353
354
355**Parameters**
356
357| Name                                       | Description                                                      |
358| --------------------------------------------- | ---------------------------------------------------------- |
359| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
360| 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.                    |
361| const uint64_t *trueForm                      | Pointer to the integer array to add.                                  |
362| size_t length                                 | Length of the integer array to add.    |
363
364**Returns**
365
366| Type| Description                                                        |
367| ---- | ------------------------------------------------------------ |
368| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
369
370### OH_Value_GetType()
371
372```
373int OH_Value_GetType(OH_Data_Value *value, OH_ColumnType *type)
374```
375
376**Description**
377
378Obtains the data type.
379
380**Since**: 18
381
382
383**Parameters**
384
385| Name                                       | Description                                                      |
386| --------------------------------------------- | ---------------------------------------------------------- |
387| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
388| [OH_ColumnType](#oh_columntype) *type         | Pointer to the data type obtained.                              |
389
390**Returns**
391
392| Type| Description                                                        |
393| ---- | ------------------------------------------------------------ |
394| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
395
396### OH_Value_IsNull()
397
398```
399int OH_Value_IsNull(OH_Data_Value *value, bool *val)
400```
401
402**Description**
403
404Checks whether a value is null.
405
406**Since**: 18
407
408
409**Parameters**
410
411| Name                                       | Description                                                      |
412| --------------------------------------------- | ---------------------------------------------------------- |
413| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
414| bool *val                                     | Pointer to the check result. The value **true** means the value is null, and the value **false** means the opposite.               |
415
416**Returns**
417
418| Type| Description                                                        |
419| ---- | ------------------------------------------------------------ |
420| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that invalid parameters are specified.|
421
422### OH_Value_GetInt()
423
424```
425int OH_Value_GetInt(OH_Data_Value *value, int64_t *val)
426```
427
428**Description**
429
430Obtains the integer from an **OH_Data_Value** instance.
431
432**Since**: 18
433
434
435**Parameters**
436
437| Name                                       | Description                                                      |
438| --------------------------------------------- | ---------------------------------------------------------- |
439| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
440| int64_t *val                                  | Pointer to the integer data obtained.                    |
441
442**Returns**
443
444| Type| Description                                                        |
445| ---- | ------------------------------------------------------------ |
446| 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.|
447
448### OH_Value_GetReal()
449
450```
451int OH_Value_GetReal(OH_Data_Value *value, double *val)
452```
453
454**Description**
455
456Obtains the REAL data from an **OH_Data_Value** instance.
457
458**Since**: 18
459
460
461**Parameters**
462
463| Name                                       | Description                                                      |
464| --------------------------------------------- | ---------------------------------------------------------- |
465| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
466| double *val                                   | Pointer to the REAL data obtained.                |
467
468**Returns**
469
470| Type| Description                                                        |
471| ---- | ------------------------------------------------------------ |
472| 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.|
473
474### OH_Value_GetText()
475
476```
477int OH_Value_GetText(OH_Data_Value *value, const char **val)
478```
479
480**Description**
481
482Obtains the string from an **OH_Data_Value** instance.
483
484**Since**: 18
485
486
487**Parameters**
488
489| Name                                       | Description                                                        |
490| --------------------------------------------- | ------------------------------------------------------------ |
491| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
492| const char **val                              | Double 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 **value**.|
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_Value_GetBlob()
501
502```
503int OH_Value_GetBlob(OH_Data_Value *value, const uint8_t **val, size_t *length)
504```
505
506**Description**
507
508Obtains the BLOB data from an **OH_Data_Value** instance.
509
510**Since**: 18
511
512
513**Parameters**
514
515| Name                                       | Description                                                        |
516| --------------------------------------------- | ------------------------------------------------------------ |
517| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
518| 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 **value**.|
519| size_t *length                                | Pointer to the length of the BLOB 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_Value_GetAsset()
528
529```
530int OH_Value_GetAsset(OH_Data_Value *value, Data_Asset *val)
531```
532
533**Description**
534
535Obtains the asset from an **OH_Data_Value** instance.
536
537**Since**: 18
538
539
540**Parameters**
541
542| Name                                       | Description                                                        |
543| --------------------------------------------- | ------------------------------------------------------------ |
544| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
545| [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 operation fails.|
546
547**Returns**
548
549| Type| Description                                                        |
550| ---- | ------------------------------------------------------------ |
551| 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.|
552
553### OH_Value_GetAssetsCount()
554
555```
556int OH_Value_GetAssetsCount(OH_Data_Value *value, size_t *length)
557```
558
559**Description**
560
561Obtains the length of the assets in an **OH_Data_Value** instance.
562
563**Since**: 18
564
565
566**Parameters**
567
568| Name                                       | Description                                                      |
569| --------------------------------------------- | ---------------------------------------------------------- |
570| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
571| size_t *length                                | Pointer to the length of the ASSETS data obtained.              |
572
573**Returns**
574
575| Type| Description                                                        |
576| ---- | ------------------------------------------------------------ |
577| 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.|
578
579### OH_Value_GetAssets()
580
581```
582int OH_Value_GetAssets(OH_Data_Value *value, Data_Asset **val, size_t inLen, size_t *outLen)
583```
584
585**Description**
586
587Obtains the assets from an **OH_Data_Value** instance.
588
589**Since**: 18
590
591
592**Parameters**
593
594| Name                                       | Description                                                        |
595| --------------------------------------------- | ------------------------------------------------------------ |
596| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
597| [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 operation fails.|
598| size_t inLen                                  | Size of **val**, which can be obtained using [OH_Values_GetAssetsCount](capi-oh-data-values-h.md#oh_values_getassetscount).|
599| size_t *outLen                                | Pointer to the actual length of the data obtained.                      |
600
601**Returns**
602
603| Type| Description                                                        |
604| ---- | ------------------------------------------------------------ |
605| 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.|
606
607### OH_Value_GetFloatVectorCount()
608
609```
610int OH_Value_GetFloatVectorCount(OH_Data_Value *value, size_t *length)
611```
612
613**Description**
614
615Obtains the length of the float array in an **OH_Data_Value** instance.
616
617**Since**: 18
618
619
620**Parameters**
621
622| Name                                       | Description                                                      |
623| --------------------------------------------- | ---------------------------------------------------------- |
624| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
625| size_t *length                                | Pointer to the length of the float data obtained.           |
626
627**Returns**
628
629| Type| Description                                                        |
630| ---- | ------------------------------------------------------------ |
631| int  | Returns an error code.<br>**RDB_OK** indicates the operation is successful.<br>**RDB_E_INVALID_ARGS** indicates that 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.|
632
633### OH_Value_GetFloatVector()
634
635```
636int OH_Value_GetFloatVector(OH_Data_Value *value, float *val, size_t inLen, size_t *outLen)
637```
638
639**Description**
640
641Obtains the float array from an **OH_Data_Value** instance.
642
643**Since**: 18
644
645
646**Parameters**
647
648| Name                                       | Description                                                        |
649| --------------------------------------------- | ------------------------------------------------------------ |
650| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
651| 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 operation fails.|
652| size_t inLen                                  | Size of **val**, which can be obtained using [OH_Values_GetFloatVectorCount](capi-oh-data-values-h.md#oh_values_getfloatvectorcount).|
653| size_t *outLen                                | Pointer to the actual length of the data obtained.                      |
654
655**Returns**
656
657| Type| Description                                                        |
658| ---- | ------------------------------------------------------------ |
659| 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.|
660
661### OH_Value_GetUnlimitedIntBand()
662
663```
664int OH_Value_GetUnlimitedIntBand(OH_Data_Value *value, size_t *length)
665```
666
667**Description**
668
669Obtains the length of the unlimited integer from an **OH_Data_Value** instance.
670
671**Since**: 18
672
673
674**Parameters**
675
676| Name                                       | Description                                                      |
677| --------------------------------------------- | ---------------------------------------------------------- |
678| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.|
679| size_t *length                                | Pointer to the length of the integer obtained.                    |
680
681**Returns**
682
683| Type| Description                                                        |
684| ---- | ------------------------------------------------------------ |
685| 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.|
686
687### OH_Value_GetUnlimitedInt()
688
689```
690int OH_Value_GetUnlimitedInt(OH_Data_Value *value, int *sign, uint64_t *trueForm, size_t inLen, size_t *outLen)
691```
692
693**Description**
694
695Obtains the unlimited integer from an **OH_Data_Value** instance.
696
697**Since**: 18
698
699
700**Parameters**
701
702| Name                                       | Description                                                        |
703| --------------------------------------------- | ------------------------------------------------------------ |
704| [OH_Data_Value](capi-rdb-oh-data-value.md) *value | Pointer to the [OH_Data_Value](capi-rdb-oh-data-value.md) instance.  |
705| 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.        |
706| 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 operation fails.|
707| size_t inLen                                  | **trueForm** length, which can be obtained using [OH_Values_GetUnlimitedIntBand](capi-oh-data-values-h.md#oh_values_getunlimitedintband).|
708| size_t *outLen                                | Pointer to the actual length of the data obtained.                      |
709
710**Returns**
711
712| Type| Description                                                        |
713| ---- | ------------------------------------------------------------ |
714| 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.|
715