6. Embedded SQL for BASIC : BASIC Variables and Data Types : Variable Usage : Simple Variables
 
Share this page                  
Simple Variables
A simple scalar-valued variable (integer, real or character string) is referred to by the syntax:
:simplename
Syntax Notes:
If you use the variable to send values to Ingres, it can be any scalar-valued variable or constant.
If you use the variable to receive values from Ingres, it can only be a scalar-valued variable.
The reference to an uninitialized BASIC dynamic string variable in an embedded statement that assigns the value of that string to Ingres results in a runtime error because an uninitialized dynamic string points at a zero address. This restriction does not apply to the retrieval of data into an uninitialized dynamic string variable.
The following program fragment demonstrates a typical message-handling routine that has two scalar valued variables, "buffer" and "seconds."
100        sub message_handle
        exec sql include sqlca
        exec sql begin declare section
            declare string buffer = 50
            declare integer seconds
        exec sql end declare section
            ...
        exec frs message :buffer
        exec frs sleep :seconds
            ...
        end sub