18.2.6 Notes about using the CLI functions
This section describes the valid address period and boundary alignment that are specified in the arguments of CLI functions.
- Organization of this subsection
(1) Valid period of area
Operations cannot be guaranteed if an address specified in a CLI function argument is no longer valid because the area indicated by the address has been released.
You must ensure that the arguments listed below that specify an address to a CLI function are valid throughout the processing (from the beginning to the end of the processing):
-
Arguments that must be valid from the time the application program is connected to the HADB server until it is disconnected from the HADB server:
-
ConnectionHandle of each CLI function
-
ResultInfo of a_rdb_SQLConnect() (if SQL results information is acquired)
-
-
Arguments that must be valid from the time a cursor is opened until it is closed:
-
TargetValue and StrLen_or_Ind members of the ColumnInfo structure of a_rdb_SQLBindCols()
-
ParameterValue and Ind members of the ParameterInfo structure of a_rdb_SQLBindParams() and a_rdb_SQLBindArrayParams()
For the arguments of a_rdb_SQLBindParams() and a_rdb_SQLBindArrayParams(), you must ensure that the area is valid until a_rdb_SQLExecute() is executed, even when an SQL statement that does not use a cursor is preprocessed.
-
There are no arguments that are required to be valid from transaction startup to transaction termination.
(2) Boundary alignment
For each SQL data type, you must apply boundary alignment to the start address of the area for storing information, such as data for retrieval results and input values of dynamic parameters, according to the following table.
No. |
SQL data type |
Boundary alignment |
---|---|---|
1 |
VARCHAR type VARBINARY type |
2-byte boundary |
2 |
SMALLINT type |
4-byte boundary |
3 |
INTEGER type |
8-byte boundary |
4 |
DOUBLE PRECISION type |