Statement Clause: .-,-----------------------------. V | |----status_var-- =--+-ROW_COUNT-+-+----------------------------| +-NUMBER----+ '-MORE------'
| Element | Description | Restrictions | Syntax | 
|---|---|---|---|
| status_var | Host variable to receive status information about the most recent SQL statement for the specified status field name | Must match data type of the field | Language specific | 
When retrieving count and overflow information, GET DIAGNOSTICS can deposit the values of the three statement fields into a corresponding host variable. The host-variable data type must be the same as that of the requested field. The following keywords represent these three fields.
| Field Name Keyword | Field Data Type | Field Contents | ESQL/C Host Variable Data Type | 
|---|---|---|---|
| MORE | Character | Y or N | char[2] | 
| NUMBER | Integer | 1 to 35,000 | int | 
| ROW_COUNT | Integer | 0 to 999,999,999 | int | 
Use the MORE keyword to determine if the most recently executed SQL statement resulted in the following actions by the database server:
If so, GET DIAGNOSTICS returns a value of N.
If so, GET DIAGNOSTICS returns a value of Y. (The value of MORE is always N.)
The ROW_COUNT keyword returns the number of rows the most recently executed DML statement processed. ROW_COUNT counts these rows:
The NUMBER keyword returns the number of exceptions that the most recently executed SQL statement raised. The NUMBER field can hold a value from 1 to 35,000, depending on how many exceptions are counted.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]