NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
I-11
Indicator Variables and Indicator Parameters
Guardian names in the INDEXES table are fully qualified and use uppercase characters.
The Guardian security vector (column 13) is stored as uppercase characters.
Indicator Variables and Indicator Parameters
In a host program, a variable called an indicator variable is associated with each SQL
data item that can contain a null value. The value of the indicator variable tells whether
the corresponding data item is null (indicator is less than 0) or contains an actual value
(indicator is 0).
Each indicator variable is a two-byte integer variable declared in the program. If you use
INVOKE to generate record descriptions, INVOKE automatically includes an indicator
variable for each item in the record that allows null values.
The INSERT, UPDATE, and SELECT statements use indicator variables. To send a null
value to SQL for insertion, update, or comparison, you assign a value less than 0 to the
indicator variable. To return a null value to your program, SQL sets the appropriate
indicator variable to -1; to return a non-null value, SQL sets the indicator variable to 0.
(For INSERT or UPDATE, you can use the keyword NULL instead of an indicator
variable.)
Indicator parameters serve the same purpose as indicator variables, but you use them to
specify null input parameters in dynamic SQL or SQLCI statements. An indicator
parameter appears following the associated input variable but separated by the key word
INDICATOR. For example, the following statements pass a negative indicator
parameter (I) to SQL to indicate that the parameter P contains a null value:
SET PARAM ?I -1
INSERT INTO =EMPLOYEE VALUES (1000, ?P INDICATOR ?I);
For more information about using indicator variables or indicator parameters in host
programs, see the NonStop SQL/MP programming manual for your host language.
INFO DEFINE Command
INFO DEFINE is an SQLCI command that displays the attributes and values associated
with one or more existing DEFINEs. (INFO DEFINE is similar to the TACL command
INFO DEFINE and the OSS command info_define.)
define
is the name of an existing DEFINE or DEFINEs for which you want information.
{ define }
INFO DEFINE { ( define [, define ] ... ) } [, DETAIL ];