Hitachi

Hitachi Advanced Database Application Development Guide


19.4.4 a_rdb_SQLBindParams() (associate dynamic parameters)

Organization of this subsection

(1) Function

This CLI function binds (associates) the dynamic parameters in an SQL statement with an area for specifying their values.

(2) Format

signed short a_rdb_SQLBindParams
(
  void                          *ConnectionHandle,   /* In  */
  void                          *StatementHandle,    /* In  */
  unsigned short                 ParameterCount,     /* In  */
  a_rdb_SQLParameterInfo_t      *ParameterInfo,      /* In  */
  void                          *Option              /* In  */
)

(3) Arguments

ConnectionHandle

Specifies a connection handle.

StatementHandle

Specifies a statement handle.

ParameterCount

Specifies the number of dynamic parameters to which values are to be assigned.

Specify the number of dynamic parameters acquired by a_rdb_SQLNumParams().

ParameterInfo

Specifies the start address of the parameter information area in which the addresses of the value storage areas are to be set.

Provide an area in which as many a_rdb_SQLParameterInfo_t structures as is specified for ParameterCount can be placed consecutively.

For details about the a_rdb_SQLParameterInfo_t structure, see 19.7.5 a_rdb_SQLParameterInfo_t structure (parameter information).

Option

Specifies NULL.

(4) Return value

  1. If a_rdb_SQLBindParams() terminates normally, a_rdb_RC_SQL_SUCCESS is returned.

  2. If the dynamic parameters are associated successfully, but the disk containing client message log files has become full, a_rdb_RC_SQL_WARNING is returned.

  3. If an error occurs while messages cannot be output to the client message log file, the error cause code is returned. For details about the error cause code, see 19.8 Return values of the CLI functions.

(5) Notes

  1. You must apply boundary alignment to the start addresses of the data storage areas of the a_rdb_SQLParameterInfo_t structure. For details about boundary alignment, see (2) Boundary alignment in 18.2.6 Notes about using the CLI functions.

  2. a_rdb_SQLBindParams() cannot be executed in the following cases:

    • Connection has not been established.

    • An invalid statement handle is specified.

    • The specified number of dynamic parameters is not the value acquired by a_rdb_SQLNumParams().