Portion of Statement | Description |
Values of constants within expressions | A variable can contain a value to be matched in a database qualification (where clause), a value to be stored in a database column or an operand in a complex expression. The variable must contain a single value of an appropriate data type, and must not be a string containing multiple operands or operators. |
Qualifications | A string variable can be used to specify an entire qualification (where clause), including names of range variables and columns, values to be matched, and QUEL functions. This string variable must not contain names of host language functions or other host language variables which are not understood by the database management system. This feature allows considerable flexibility in programs, permitting applications to construct a "where clause" from parameters that the user specifies at runtime. |
Names of database objects | The general rule when using variable substitution for database object names, (such as range variables, tables, and columns) is that one variable can substitute for one name in a statement: for example, you cannot assign a string variable a value such as "e.salary"; you must specify the range variable e and the column salary using separate host variables. When using a variable to specify a database name, you can use a single string variable to specify both the network node and database name. |
Miscellaneous arguments | In general, constant values for statement arguments can be specified using host variables of the appropriate data type. For example, the components of a with clause on the index and copy statements, and the items in a define permit or a save statement, can be represented by host variables. In the sort clause of a retrieve statement, the sort keys can be specified individually using string variables containing the name of a result column. A string variable can be used to specify the entire target_list on the create, copy, define view and declare cursor statements. |