The SET SCHEMA statement changes the default schema.
USER means that the schema is changed to the current user name.
user_name must be a valid user name in the database.
As per ANSI SQL-92 standard, the user_name and schema_name can be enclosed in single quotation marks.
solidDB® supports SQL89 style schemas. Schemas are used to help uniquely identify entities (tables, views) within a database. By using schemas, each user can create database objects without the risk of using names that already in use.
To identify an entity (such as a table) uniquely, you qualify it by specifying the catalog name and schema name using the syntax [catalog_name.][schema_name.]database_object. For example,
FinanceCatalog.AccounstReceivableSchema.CustomersTable is a qualified table name.
The algorithm to resolve entity names [catalog_name.][schema_name.]database_object is as follows:
1 If schema_name is given, database_object is searched only from that schema.
2 If schema_name is not given:
a First database_object is searched from default schema. Default schema is initially the same as user name, but can be changed with SET SCHEMA statement
b Then database_object is searched from all schemas in the database. If more than one entity with same database_object and type (table, stored procedure, ...) is found, the following error is returned:
13111, Table Error: Ambiguous entity name database_object.
The SET SCHEMA statement affects only the default entity name resolution. It does not change any access rights to database entities. The SET SCHEMA statement sets the default schema name for unqualified names in statements that are prepared in the current session by an EXECDIRECT statement or a prepare statement.