Hitachi

Hitachi Advanced Database Application Development Guide


16.7.5 SQLDescribeParam

Organization of this subsection

(1) Function

This ODBC function returns information about a dynamic parameter that has been obtained by executing SQLPrepare. This information is set in the fields of the IPD.

(2) Format

SQLRETURN SQLDescribeParam
(
  SQLHSTMT          StatementHandle,    /* In */
  SQLUSMALLINT      ParameterNumber,    /* In */
  SQLSMALLINT     * DataTypePtr,        /* Out */
  SQLULEN         * ParameterSizePtr,   /* Out */
  SQLSMALLINT     * DecimalDigitsPtr,   /* Out */
  SQLSMALLINT     * NullablePtr         /* Out */
)

(3) Arguments

StatementHandle

Specifies a statement handle.

ParameterNumber

Specifies a parameter number. Parameter numbers are assigned in ascending order, beginning with 1.

DataTypePtr

Specifies a pointer to the buffer in which the parameter's SQL data type is to be returned.

ParameterSizePtr

Specifies a pointer to the buffer in which the size of the column or expression of the corresponding parameter is returned. The information defined by the data source is returned.

DecimalDigitsPtr

Specifies a pointer to the buffer in which the number of decimal places in the column or expression of the corresponding parameter is returned. The information defined by the data source is returned.

NullablePtr

Specifies a pointer to the buffer in which a value indicating whether the parameter accepts null values is returned. This value is read from the SQL_DESC_NULLABLE field of the IPD. One of the following values is returned:

  • SQL_NO_NULLS

    The parameter does not accept null values.

  • SQL_NULLABLE

    The parameter accepts null values.

(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

Y

08S01

Communication link failure

N

21S01

Insert value list does not match column list

N

HY000

General error

N

HY001

Memory allocation error

N

HY008

Operation cancelled

N

HY010

Function sequence error

Y

HY013

Memory management error

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