Hitachi

Hitachi Advanced Database Application Development Guide


16.6.4 SQLSetDescRec

Organization of this subsection

(1) Function

This ODBC function sets values in multiple descriptor record fields in the same descriptor record.

(2) Format

SQLRETURN SQLSetDescRec
(
  SQLHDESC        DescriptorHandle,    /* In */
  SQLSMALLINT     RecNumber,           /* In */
  SQLSMALLINT     Type,                /* In */
  SQLSMALLINT     SubType,             /* In */
  SQLLEN          Length,              /* In */
  SQLSMALLINT     Precision,           /* In */
  SQLSMALLINT     Scale,               /* In */
  SQLPOINTER      DataPtr,             /* Deferred  In */
  SQLLEN        * StringLengthPtr,     /* Deferred  In */
  SQLLEN        * IndicatorPtr         /* Deferred  In */
)

(3) Arguments

DescriptorHandle

Specifies a descriptor handle. This must not be an IRD handle.

RecNumber

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

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

Type

Specifies the value to be set in the SQL_DESC_TYPE field for the descriptor record.

SubType

Specifies the value to be set in the SQL_DESC_DATETIME_INTERVAL_CODE field for the descriptor record.

Length

Specifies the value to be set in the SQL_DESC_OCTET_LENGTH field for the descriptor record.

Precision

Specifies the value to be set in the SQL_DESC_PRECISION field for the descriptor record.

Scale

Specifies the value to be set in the SQL_DESC_SCALE field for the descriptor record.

DataPtr

Specifies the value to be set in the SQL_DESC_DATA_PTR field for the descriptor record.

StringLengthPtr

Specifies the value to be set in the SQL_DESC_OCTET_LENGTH_PTR field for the descriptor record.

IndicatorPtr

Specifies the value to be set in the SQL_DESC_INDICATOR_PTR field for the descriptor record.

(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

07009

Invalid descriptor index

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

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

Y

08S01

Communication link failure

--

N

HY000

General error

N

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.

Y

HY021

Inconsistent descriptor information

--

Y

HY090

Invalid string or buffer length

N

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