Precompiler Throws PCC-S-02201 with the SQL REPLACE Statement (Doc ID 1396714.1)

Last updated on JULY 05, 2017

Applies to:

Precompilers - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

Pro*C fails to recognise the SQL REPLACE function and throws a syntax error at compilation:

PCC-S-02201, Encountered the symbol "REPLACE" when expecting one of the following:
; end-exec, table, or, random_terminal function, package,
procedure, type, schema, trigger, view, role, constraints,
transaction,
The symbol "; was inserted before "REPLACE" to continue.

Error at line 0, column 0 in file sample2.pc
PCC-F-02102, Fatal error while doing C preprocessing

This only happens with embedded DDL statements.  For example:

EXEC SQL
  CREATE PROCEDURE P1 AS
    x varchar2(20);
  BEGIN
    select replace ('FRED', 'FR', 'B') into x from dual;
  END;

or:

EXEC SQL CREATE TABLE test AS select replace ('FRED', 'FR', 'B') bed from dual;

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms