Hitachi

Hitachi Advanced Database Application Development Guide


19.7.5 a_rdb_SQLParameterInfo_t structure (parameter information)

Organization of this subsection

(1) Function

The dynamic parameter information acquired by a_rdb_SQLDescribeParams() is stored in a_rdb_SQLParameterInfo_t structures.

These structures are also used when an area for specifying dynamic parameter values is associated by a_rdb_SQLBindParams() or a_rdb_SQLBindArrayParams().

For details about a_rdb_SQLDescribeParams(), see 19.4.7 a_rdb_SQLDescribeParams() (acquire dynamic parameter information). For details about a_rdb_SQLBindParams(), see 19.4.4 a_rdb_SQLBindParams() (associate dynamic parameters). For details about a_rdb_SQLBindArrayParams(), see 19.4.2 a_rdb_SQLBindArrayParams() (bind dynamic parameters in batch mode).

(2) Format

typedef struct a_rdb_TG_ParameterInfo {
  struct a_rdb_TG_DataType     *TypeInfo ;       /* Out */
  unsigned short                Nullable ;       /* Out */
  char                          _ParameterInfo_rsv01[2] ;
  a_rdb_SQLInd_t                Ind ;            /* In  */
  char                          _ParameterInfo_rsv02[3] ;
  void                         *ParameterValue;  /* In  */
  char                          _ParameterInfo_rsv03[24] ;
} a_rdb_SQLParameterInfo_t ;

(3) Members

TypeInfo

Specifies the address at which information about the data type of a dynamic parameter is to be stored.

Specify this member if you execute a parameter description. If you execute a parameter join, there is no need to specify this member; if specified, this member is ignored.

Nullable

Returns a value indicating whether the null value can be specified for the dynamic parameter.

  • The null value cannot be specified: a_rdb_SQL_IS_NOT_NULLABLE

  • The null value can be specified: a_rdb_SQL_IS_NULLABLE

This value is set for a parameter description.

Ind

Specifies an indicator value.

Specify this member if you execute a parameter join. If you execute a parameter description, there is no need to specify this member. If specified, this member is ignored.

ParameterValue

Specifies the address at which the value is to be stored.

This value must be specified as a data description in C or C++ that corresponds to the SQL data type. For details about the data descriptions in C or C++ that correspond to the SQL data types, see 19.6.2 Correspondences between SQL data types and data descriptions.

Specify this member if you execute a parameter join. If you execute a parameter description, there is no need to specify this member. If specified, this member is ignored.

(4) Notes

When you use a a_rdb_SQLParameterInfo_t structure, make sure that you first initialize the area to all zeros, and then specify a value for each member to be used.