Variables in BSQL
Host variables are used in embedded SQL statements to pass values between the database and an application program, see the Mimer SQL Programmer's Manual.
Host variables are also supported in BSQL to facilitate interactive design and testing of SQL statements intended for use in embedded SQL application programs.
In BSQL, the host variables serve as parameter markers, and the user is prompted for parameter values when the statement is executed.
Host variables may be used to:
- assign values to columns in the database (UPDATE and INSERT statements)
- to manipulate information taken from the database or contained in other variables (in expressions)
- to provide values for comparison predicates.
In all these contexts, the data type and length of the host variable must be compatible with that of any database values within the same syntax unit.
Writing Host Variables in SQL
Host variables are written in SQL as::host-identifier
or:host-identifier INDICATOR :indicator-identifier
In the first construction, the host identifier is the name of the main host variable.
In the second and third constructions, the main variable host-identifier is associated with an indicator variable indicator-identifier, used to signal the assignment of a NULL value to the main variable.
See the Mimer SQL Programmer's Manual for a description of the use of indicator variables.
Scope of Host Variables
The scope of host variables in BSQL is restricted to the individual usage instance in each statement.
Variables may not be used to pass values between separate statements, and the same variable name used more than once in a statement represents separate, independent variables.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40