Using the COUNT Keyword
Use the COUNT keyword to determine how many items are described in the system-descriptor area.
The following Informix®
ESQL/C example shows how to use a GET DESCRIPTOR statement with a host variable to determine how many items are described in the system-descriptor area called desc1:
main()
{
EXEC SQL BEGIN DECLARE SECTION;
int h_count;
EXEC SQL END DECLARE SECTION;
EXEC SQL allocate descriptor 'desc1' with max 20;
/* This section of program would prepare a SELECT or INSERT
* statement into the s_id statement id.
*/
EXEC SQL describe s_id using sql descriptor 'desc1';
EXEC SQL get descriptor 'desc1' :h_count = count;
...
}