Hitachi

Hitachi Advanced Database SQL Reference


6.8.1 About scope variables

An identifier that can serve as a qualifier for a column specification is called a scope variable. A scope variable has a name and an effective scope.

If a correlation name is specified, the table name or query name that it specifies loses its effective scope.

Among the scope variables that have an effective scope at the position of a table specification, the scope variable of the innermost (closest) query specification (table to be updated or deleted) that has the same name as the table specification will act as that table specification's scope variable.

The following table shows what types of identifiers can act as scope variables.

Table 6‒14: Types of identifiers that can act as scope variables

No.

Scope variable

Scope?

1

Correlation name

Y

2

Table name or query name

Correlation name is not specified.

Y

3

Correlation name is specified.

N

4

Table whose contents are to be updated by an UPDATE statement or deleted by a DELETE statement

Correlation name is not specified.

Y

5

Correlation name is specified.

N

Legend:

Y: Can be a scope variable.

N: Cannot be a scope variable.