ALTER SESSION returns ORA-02421 missing or invalid schema authorization identifier. (Doc ID 848248.1)

Last updated on AUGUST 30, 2017

Applies to:

Precompilers - Version 9.2.0.8.0 and later
Information in this document applies to any platform.
*** Checked for relevance on 30-Aug-2017 ***

Symptoms

Attempting to execute the ALTER SESSION command with a bind variable is failing.

EXEC SQL
     ALTER SESSION SET CURRENT_SCHEMA = :SCHEMA1
END-EXEC

The error being reported is:

ORA-02421 missing or invalid schema authorization identifier.


Using the same host variable within an INSERT works.

EXEC SQL
     INSERT INTO TESTTABLE VALUES (':SCHEMA1')
END-EXEC

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