CLOSE SCHEMA

Purpose

Use this statement to close the current schema which affects the name resolution.

Prerequisite

You need either the system privilege USE ANY SCHEMA or the object privilege USAGE on the target schema, or the schema must be owned by you or one of your assigned roles.

Syntax

close_schema::=

Close Schema Statement

Usage Notes

If there is no schema opened, all the schema objects must be referenced using schema-qualified names (for more information, see SQL identifier).

Example

OPEN SCHEMA my_schema;
SELECT * FROM my_table;
CLOSE SCHEMA;
SELECT * FROM my_table; -- Error: object MY_TABLE not found
SELECT * FROM my_schema.my_table;