openharmony 鸿蒙 capi-oh-cursor-h

2026-08-25 浏览 (1)

oh_cursor.h

Overview

Provides APIs to access the result set obtained by querying the RDB store. A result set is a set of results returned by query().

File to include: <database/rdb/oh_cursor.h>

Library: libnative_rdb_ndk.z.so

System capability: SystemCapability.DistributedDataManager.RelationalStore.Core

Since: 10

Related module: RDB

Summary

Structs

Nametypedef KeywordDescription
OH_CursorOH_CursorProvides APIs to access the result set obtained by querying the RDB store. A result set is a set of results returned by query().

Functions

NameDescription
int OH_Cursor_GetFloatVectorCount(OH_Cursor *cursor, int32_t columnIndex, size_t *length)Obtains the length of a floating-point array in the specified column of the current row.
int OH_Cursor_GetFloatVector(OH_Cursor *cursor, int32_t columnIndex, float *val, size_t inLen, size_t *outLen)Obtains the value in the specified column of the current row in the form of a floating-point array.

Function Description

OH_Cursor_GetFloatVectorCount()

int OH_Cursor_GetFloatVectorCount(OH_Cursor *cursor, int32_t columnIndex, size_t *length)

Description

Obtains the length of a floating-point array in the specified column of the current row.

Since: 18

Parameters

ParameterDescription
OH_Cursor *cursorPointer to the OH_Cursor instance.
int32_t columnIndexIndex of the column, which starts from 0.
size_t *lengthPointer to the length of the float array obtained.

Returns

TypeDescription
intReturns an execution result.
RDB_OK indicates that the operation is successful.
RDB_E_ERROR indicates a common database error.
RDB_E_INVALID_ARGS indicates that invalid parameters are specified.
RDB_E_SQLITE_CORRUPT indicates that the database is corrupted.
RDB_E_STEP_RESULT_CLOSED indicates the result set is closed.
RDB_E_ALREADY_CLOSED indicates that the database is already closed.
RDB_E_SQLITE_PERM indicates an SQLite error: access denied.
RDB_E_SQLITE_BUSY indicates an SQLite error: database file locked.
RDB_E_SQLITE_LOCKED indicates an SQLite error: database table locked.
RDB_E_SQLITE_NOMEM indicates an SQLite: insufficient database memory.
RDB_E_SQLITE_IOERR indicates an SQLite: disk I/O error.
RDB_E_SQLITE_TOO_BIG indicates an SQLite error: TEXT or BLOB exceeds the limit.
RDB_E_SQLITE_MISMATCH indicates an SQLite error: data types mismatch.

OH_Cursor_GetFloatVector()

int OH_Cursor_GetFloatVector(OH_Cursor *cursor, int32_t columnIndex, float *val, size_t inLen, size_t *outLen)

Description

Obtains the value in the specified column of the current row in the form of a floating-point array.

Since: 18

Parameters

ParameterDescription
OH_Cursor *cursorPointer to the OH_Cursor instance.
int32_t columnIndexIndex of the column, which starts from 0.
float *valPonter to the value obtained, in a float array. The caller needs to apply for the memory.
size_t inLenLength of the float array requested.
size_t *outLenPointer to the actual length of the float array.

Returns

TypeDescription
intReturns an execution result.
RDB_OK indicates that the operation is successful.
RDB_E_ERROR indicates a common database error.
RDB_E_INVALID_ARGS indicates that invalid parameters are specified.
RDB_E_SQLITE_CORRUPT indicates that the database is corrupted.
RDB_E_STEP_RESULT_CLOSED indicates the result set is closed.
RDB_E_ALREADY_CLOSED indicates that the database is already closed.
RDB_E_SQLITE_PERM indicates an SQLite error: access denied.
RDB_E_SQLITE_BUSY indicates an SQLite error: database file locked.
RDB_E_SQLITE_LOCKED indicates an SQLite error: database table locked.
RDB_E_SQLITE_NOMEM indicates an SQLite: insufficient database memory.
RDB_E_SQLITE_IOERR indicates an SQLite: disk I/O error.
RDB_E_SQLITE_TOO_BIG indicates an SQLite error: TEXT or BLOB exceeds the limit.
RDB_E_SQLITE_MISMATCH indicates an SQLite error: data types mismatch.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-distributedKVStore-sys

openharmony 鸿蒙 capi-oh-preferences-h

openharmony 鸿蒙 capi-udmf-oh-udshyperlink

openharmony 鸿蒙 js-apis-data-dataSharePredicates

openharmony 鸿蒙 capi-udmf-oh-udsappitem

openharmony 鸿蒙 capi-rdb-oh-data-vbuckets

openharmony 鸿蒙 capi-rdb-oh-predicates

openharmony 鸿蒙 capi-rdb-oh-data-value

openharmony 鸿蒙 capi-preferences-oh-preferencespair

openharmony 鸿蒙 errorcode-datashare

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/Pn1GHubb