Hitachi

Hitachi Advanced Database Application Development Guide


16.6.3 SQLSetDescField, SQLSetDescFieldW

Organization of this subsection

(1) Function

This ODBC function sets the value of a descriptor field specified in the arguments.

(2) Format

(3) Arguments

DescriptorHandle

Specifies a descriptor handle.

RecNumber

Specifies a column number (ARD or IRD) or a parameter number (APD or IPD).

If FieldIdentifier indicates a header field, this argument is ignored.

If there is no descriptor record with the record number specified in this argument, this function creates a descriptor record with that record number.

FieldIdentifier

Specifies the field (header or record field) of the descriptor whose value is to be set. For details about the attributes that can be specified, see 16.17 Attributes that can be specified in SQLGetDescField, SQLGetDescFieldW, SQLSetDescField, and SQLSetDescFieldW.

ValuePtr

Specifies the descriptor information to be set (pointer or integer value). For details about the values that can be specified, see 16.17 Attributes that can be specified in SQLGetDescField, SQLGetDescFieldW, SQLSetDescField, and SQLSetDescFieldW.

BufferLength

If the data type of the descriptor field specified in FieldIdentifier is character string or binary, this argument specifies the length of *ValuePtr (in bytes). If it is any other data type, this argument is ignored.

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_ERROR, or SQL_INVALID_HANDLE.

(5) SQLSTATE

This ODBC function returns one of the following SQLSTATE values:

SQLSTATE

Description

Remarks

Returned

01000

General warning

--

N

01S02

Option value changed

N

07009

Invalid descriptor index

  • The value specified in RecNumber is less than or equal to 0.

  • RecNumber is greater than the maximum number of columns or parameters supported by the data source and DescriptorHandle is associated with an ARD or APD.

  • FieldIdentifier is SQL_DESC_COUNT and the value specified in ValuePtr is less than 0.

Y

08S01

Communication link failure

--

N

22001

Character string data was right-truncated

N

5C002

Character encoding conversion error

A character code that cannot be converted was detected.

Y

HY001

Memory allocation error

--

Y

HY010

Function sequence error

Before this function was executed, SQLExecute, SQLExecDirect, SQLExecDirectW, or SQLParamData was called for StatementHandle associated with DescriptorHandle and returned SQL_NEED_DATA. Since then, the setting of runtime data parameters or runtime data columns has not been completed.

Y

HY013

Memory management error

--

N

HY016

Cannot modify an implementation row descriptor

DescriptorHandle is associated with an IRD, but FieldIdentifier is not SQL_DESC_ARRAY_STATUS_PTR or SQL_DESC_ROWS_PROCESSED_PTR

Y

HY021

Inconsistent descriptor information

--

N

HY090

Invalid string or buffer length

N

HY091

Invalid descriptor field identifier

  • The value specified in FieldIdentifier is neither an ODBC-defined field nor an implementation-defined value.

  • FieldIdentifier is invalid for DescriptorHandle.

Y

HY092

Invalid attribute or option identifier

  • The value set in ValuePtr is invalid for the value specified in FieldIdentifier.

  • FieldIdentifier is SQL_DESC_UNNAMED and ValuePtr is SQL_NAMED.

Y

HY105

Invalid parameter type

The value specified in the SQL_DESC_PARAMETER_TYPE field is invalid (the value is not SQL_PARAM_INPUT).

Y

HYT01

Connection timeout expired

--

N

IM001

Driver does not support this function

N

Legend:

Y: This SQLSTATE might be returned by the HADB ODBC driver.

N: This SQLSTATE is not returned by the HADB ODBC driver.

--: None