FrontBase Documentation |
Backtrack: Welcome! 5. SQL 92 5.1. SQL 92 Primer |
Updated:
20-Nov-2000
prev next Table of Contents |
The concept of users in SQL 92 is relatively simple, but is tied very closely to the concept of schemas.To access a database, a user name is required, otherwise access is denied (FrontBase offers password protection as an extension to SQL 92).
When a new database is created, a number of user names are also created, among which are:
_SYSTEM
and_PUBLIC
. Both these user names are considered by SQL 92 as special user names. In fact, the leading underscore cannot be used in regular identifiers.To create a new user:
CREATE USER <user name> [DEFAULT SCHEMA <schema name>];
To change the default schema:
ALTER USER <user name> SET DEFAULT SCHEMA <schema name>;
The optional
<schema name>
, which must exist when the user name is created, will be the default schema for the user whenever the database is accessed. If no default<schema name>
is given, a schema with the same spelling as the user name is created and used as default this will happen the first time the user accesses the database.To see who is the current user, the USER and CURRENT_USER string functions can be used. USER is simply a shorthand for CURRENT_USER.
To make a user name the current user:
SET SESSION AUTHORIZATION <user name>;
To see the list of defined user names:
SELECT * FROM INFORMATION_SCHEMA.USERS;
If you have feedback or questions on this document, please send e-mail to doc-feedback@frontbase.com. Please reference the section number and topic. Thanks!!
©2000 FrontBase, Inc. All rights reserved.