Mimer SQL User's Manual TOC PREV NEXT INDEX

Mimer Developer Site

www.mimer.com/developer


Using Host Variables


When host variables are used in BSQL, BSQL prompts for the variable values, for example:

 SQL>SELECT * FROM HOTEL WHERE CITY = :CITY;
 CITY: STOCKHOLM
 

This statement is then executed as

 SQL>SELECT * FROM HOTEL WHERE CITY = 'STOCKHOLM';
 
Note: The entered variable is not enclosed between apostrophes, in contrast to the corresponding string value.
Variables enclosed in apostrophes will be interpreted as literal strings.

Including Indicator Variables

If an indicator variable is included, you will be prompted for whether to use a NULL value.

If you answer the prompt with No, you will then be prompted for a value.

If you answer Yes, the NULL value will be used.

For example:

 SQL>UPDATE BOOK_GUEST SET ARRIVE    = :ARRIVE:NULL,
 SQL>                      DEPART    = :DEPART:NULL
 SQL>  WHERE RESERVATION = 1348;
 Null:N
 ARRIVE: 2001-04-23
 Null:Y
 
Note: The prompts appear in the order in which the variables are used in the statement. In the example above, the ARRIVE value will be updated to 2001-04-23 and the DEPART value will be set to NULL.


Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL User's Manual TOC PREV NEXT INDEX