Hitachi

Hitachi Advanced Database Application Development Guide


19.7.6 a_rdb_SQLResultInfo_t structure (SQL results information)

Organization of this subsection

(1) Function

SQL results information is stored in an a_rdb_SQLResultInfo_t structure for each CLI function call.

(2) Format

typedef struct a_rdb_TG_ResultInfo {
  unsigned long long  RowCount ;                  /* Out */
  unsigned char       isInConnect ;               /* Out */
  unsigned char       EndTran ;                   /* Out */
  unsigned char       RowCountOverFlowed ;        /* Out */
  unsigned char       isMessageLogFull ;          /* Out */
  unsigned char       isClientLogFull ;           /* Out */
  char                _ResultInfo_rsv01[3] ;
  char                SQLState[5] ;               /* Out */
  char                _ResultInfo_rsv02[11] ;
} a_rdb_SQLResultInfo_t ;

(3) Members

RowCount

Returns the number of results rows when the CLI function's return value is a_rdb_RC_SQL_SUCCESS or a_rdb_RC_SQL_NO_DATA. Otherwise, RowCount returns a value 0.

The number of rows that have been processed is returned, in the range from 0 to 18,446,744,073,709,551,615.

If overflow occurs (if the returned value exceeds 18,446,744,073,709,551,615), 18,446,744,073,709,551,615 is returned and a_rdb_SQL_OVERFLOWED is set in RowCountOverFlowed.

isInConnect

Returns a value indicating whether a connection has been established (currently connected):

  • Connection has not been established: a_rdb_SQL_IS_NOT_IN_CONNECT

  • Connection has been established: a_rdb_SQL_IS_IN_CONNECT

EndTran

Returns the transaction execution result:

  • Transaction terminated normally: a_rdb_SQL_COMMITTED

  • Transaction was canceled: a_rdb_SQL_ROLLBACKED

  • Transaction is executing: a_rdb_SQL_TRAN_NOT_ENDED

  • Transaction has not started yet: a_rdb_SQL_TRAN_NOT_STARTED

  • Transaction was canceled because an SQL error occurred when the transaction terminated normally: a_rdb_SQL_DETECTED_ERROR_IN_COMMIT

The following table shows the correspondences between transaction execution results and the transaction statuses.

Table 19‒10: Correspondences between transaction execution results and transaction statuses

No.

Transaction execution result

Transaction status

1

a_rdb_SQL_COMMITTED

Transaction startable#

2

a_rdb_SQL_ROLLBACKED

Transaction startable#

3

a_rdb_SQL_TRAN_NOT_ENDED

Transaction executing

4

a_rdb_SQL_TRAN_NOT_STARTED

Transaction startable

5

a_rdb_SQL_DETECTED_ERROR_IN_COMMIT

Transaction startable#

#

The transaction was completed because COMMIT or ROLLBACK was successful, and the next transaction can now be started.

RowCountOverFlowed

Returns a value indicating whether overflow occurred on RowCount:

  • Overflow has not occurred: a_rdb_SQL_NOT_OVERFLOWED

  • Overflow has occurred: a_rdb_SQL_OVERFLOWED

isMessageLogFull

Returns the mode of the server message log file.

  • Normal mode: a_rdb_SQL_IS_NOT_LOG_FULL

  • Fall-back mode: a_rdb_SQL_IS_LOG_FULL

If the server message log file is placed in fall-back mode, contact the HADB administrator.

isClientLogFull

Returns the mode of the client message log file.

  • Normal mode: a_rdb_SQL_IS_NOT_LOG_FULL

  • Fall-back mode: a_rdb_SQL_IS_LOG_FULL

If the client message log file is placed in fall-back mode, secure sufficient free space on the disk that contains the client message log file. At least twice as much free space as the size specified for the ADBMSGLOGSIZE environment variable is required.

SQLState

Returns SQLSTATE of the CLI function execution results.

For details about SQLSTATE, see List of SQLSTATE values in the manual HADB Messages.