Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Statements : CREATE USER
 

CREATE USER

Creates the specified user.

Syntax

CREATE USER {'username'|'username@domain_name'}, 'password' FOR SQL ONLY ;

Parameters

username
Specifies the username. The username must be enclosed in single quotes.
domain_name
Specifies the domain name that the user is associated with. The username@domain_name must be enclosed in single quotes.
password
Specifies the password for the user. The password must be enclosed in single quotes.

Notes

*You are strongly advised to NOT create a user named PUB. A user named PUB is inherently the owner of all tables created in the ABL and all schema tables, since these are all in the PUB schema. As the owner, a user PUB has full access to those tables, including the ability to read and write data, and the ability to drop the application table. Therefore, the existence of a user PUB creates a very serious security risk for the database. For these reasons, please do NOT create a user named PUB.
*Used in conjunction with BEGIN-END DECLARE SECTION and DROP USER statement, the CREATE USER statement provides a way to manage user records through SQL.
*The user name and password must be enclosed in quotes.
*The phrase FOR SQL ONLY is optional and if you use this phrase while issuing the CREATE USER statement, the user that is created is used only by OE SQL. This user is not available to ABL and is referred to as a SQL only user. SQL only users do not affect ABL. If an OpenEdge Database contains only SQL only users, ABL treats the database as if there are no users in it.
*Before issuing the CREATE USER statement, there are no users defined in the user table and any user can log into the database.
*After issuing the CREATE USER statement, only users defined in the user table can log into the database.
*If you are creating a user in a multi-tenant table, the created user should be associated with the tenant identified by the domain name defined in the syntax.
*The username@domainame can be equivalently defined in OpenEdge ABL. For more information on defining a user name in ABL, see OpenEdge Development: ABL Reference.

Examples

CREATE USER statement
In this example an account with DBA privileges creates the ‘username' ‘Jasper' with password ‘spaniel':
CREATE USER 'Jasper', 'spaniel' ;
CREATE USER statement with FOR SQL ONLY
In the following example, CREATE USER creates the user Jasper to connect to mtdomain domain with the password spaniel and changes the user to a SQL only user:
CREATE USER 'Jasper@mtdomain', 'spaniel' FOR SQL ONLY ;
The user Jasper should be associated with the tenant identified by the domain mtdomain.
* Authorization
* Related statements