A script-enabled browser is required for this page to function properly.

PL/SQL conversion utility: New reserved words in PL/SQL V2.3 or later

The word VARIANCE is reserved in PL/SQL V2.3 or later and, if used, generates a compiler error.

See the example for information on how to use VARIANCE without generating an error.

Examples

The example first presents PL/SQL V1 code that will generate a compiler error, then shows how you might edit the code to avoid the error.

Example 1: Removing reserved words

Change this code:

FUNCTION variance (y IN NUMBER) RETURN NUMBER IS
BEGIN
  . . .
  RETURN . . .;
END;

. . .to this:

FUNCTION varianceUniqueName (y IN NUMBER) 
/* A unique name was appended to Variance. */
RETURN NUMBER IS
BEGIN
  . . .
  RETURN . . .;
END;

Example 2: Removing reserved words in subprograms

When calling a subprogram, change the code:

PROCEDURE foo IS
  x NUMBER;
  y NUMBER;
BEGIN
  . . .
  x := variance(someNumber);
END;

. . .to this:

PROCEDURE foo IS
  x NUMBER;
  y NUMBER;
BEGIN
  . . .
  x := varianceUniqueName(someNumber);
END;

See also

About the PL/SQL conversion utility