SET

Assigns the specified value to a variable or output parameter.

set.png

 

Usage

Procedural/Interactive/Module/Embedded/Module.

Description

The SET statement directly assigns the specified value-expression to one or more target-variable’s, see Target Variables. If a target-variable is a routine parameter, it must have mode OUT or INOUT.

Restrictions

A value-expression must be assignment-compatible with the data type of its target-variable, see Assignments.

If multiple target-variables are assigned, the number of items in the row expression on the right hand of the assignment must be the same as the number of target-variables.

Notes

Where the target of the assignment is a declared variable, its name may be qualified with a scope label, see the Mimer SQL Programmer's Manual, Declaring Variables.

If the target of the assignment is a variable declared with the ROW data type, a row value expression may be specified for expression.

If is possible to assign a value to a field of a variable declared with the ROW data type by using the following syntax to refer to the field: routine-variable.field-name.

See the Mimer SQL Programmer's Manual, The ROW Data Type and Mimer SQL Programmer's Manual, Row Value Expression, for more information.

Assignment of multiple target-variables is not supported.

Examples

SET firstName = 'Moira';

 

SET pos = position(' ' IN name);

 

SET book.title = 'Grapes of Wrath';

 

SET bookTitle = ('0-201-43328-1','JDBC API Tutorial and Reference');

 

SET (CITY, COUNTRY) = ('Uppsala', 'Sweden');

 

For more information, see the Mimer SQL Programmer's Manual, Assignment Using SET.

Standard Compliance

Standard

Compliance

Comments

SQL-2016

Features outside core

Feature P002, “Computational completeness”.

Feature P006, “Multiple assignment”.