Progress
Embedded SQL-92
Guide and Reference
Using Indicator Variables
Indicator variables are optional variables you can use to handle NULL values. Each indicator variable is associated with one host variable. Indicator variables should be of C Language data type LONG or database data type INTEGER (a 32-bit signed integer). The general format for using an indicator variable in an ESQL program is:
NOTE: An indicator variable is always used with a host variable and you must prepend it with a colon ( : ) when you use it in an ESQL executable statement.INDICATOR
The
INDICATOR
keyword is not required. Using theINDICATOR
keyword clarifies the intent, especially if the names for the host variable and indicator variable do not follow a recognizable convention.Table 3–2 lists the valid values for indicator variables and describes the meaning for each value.
This list provides a summary of how and when to use indicator variables:
- Explicitly DECLARE indicator variables in the DECLARE SECTION, and do not prepend a colon ( : ) in this section.
- DECLARE indicator variables as C Language data type LONG or database data type INTEGER (a 32-bit signed integer).
- Do not prepend indicator variables with a colon ( : ) in a C Language statement.
- Precede the indicator variable with its associated host variable in an ESQL executable statement.
- Prepend the indicator variable itself with a colon ( : ) in an ESQL statement.
- Name the indicator variable with a name that is not an SQL reserved word.
For more information on indicator variables, see "Handling NULL Values in ESQL-92," and Handling Errors in ESQL-92."
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |