Start of change

-20129   LOCAL SPECIAL REGISTER IS NOT VALID AS USED

Explanation

An attempt was made to reference a special register, but the syntax was invalid for the specified special register.

The CURRENT PACKAGE PATH special register, or a local special register such as CURRENT SERVER or CURRENT PACKAGESET cannot be referenced in an assignment statement (SET or VALUES INTO) where the special register is part of an expression in the source value, or where multiple source values are being assigned to multiple targets.

The only valid uses of these special registers in a SET host-variable statement or VALUES INTO statement are:

  • SET :hv= CURRENT SERVER;
  • SET :hv= CURRENT PACKAGESET;
  • SET :hv= CURRENT PACKAGE PATH;
  • VALUES CURRENT SERVER INTO :hv;
  • VALUES CURRENT PACKAGESET INTO :hv;
  • VALUES CURRENT PACKAGE PATH INTO :hv;

These restrictions apply only when the reference to the special register appears outside of the body of a native SQL procedure or an SQL scalar function.

System action

The statement cannot be processed.

Programmer response

Correct the statement in one of the following ways:
  • Do not use the special register in an expression as the source value of a SET or VALUES INTO statement.
  • Do not assign multiple values to multiple special registers in a SET or VALUES INTO statement.

SQLSTATE

560B5

Severity

8 (error)

End of change