Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Statements : SET SCHEMA
 

SET SCHEMA

Sets the default owner, also known as schema, for unqualified table references.

Syntax

SET SCHEMA { 'string_literal' | ? | USER }

Parameters

'string_literal'
Specifies the name for the default owner as a string literal, enclosed in single or double quotes.
Indicates a parameter marker to contain the default owner. The actual replacement value for the owner name is supplied in a subsequent SQL operation.
USER
Directs the database to set the default owner back to the username that established the session.

Notes

*For authorization purposes, invoking SET SCHEMA does not change the username associated with the current session.
*You can set the default schema name to the username associated with the session by using a SET SCHEMA USER statement.

Example

This example sets the default schema name to White:
SET SCHEMA 'White' ;
COMMIT ;
SELECT * from customer ;
Subsequent SQL statements with unqualified table references will use the owner name White. The SELECT statement in this example returns all rows in the ‘White.customer' table. The username establishing the original session is still the current user.
* Authorization