CREATE USER
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Creates the specified user.
Syntax
|
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_namemust 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 SECTIONandDROP USERstatement, theCREATE USERstatement provides a way to manage user records through SQL. - The user name and password must be enclosed in quotes.
- The phrase
FOR SQL ONLYis optional and if you use this phrase while issuing theCREATE USERstatement, 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 USERstatement, there are no users defined in the user table and any user can log into the database. - After issuing the
CREATE USERstatement, 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@domainamecan be equivalently defined in OpenEdge ABL. For more information on defining a user name in ABL, see ABL Reference.
Examples
CREATE USER statement
In this example an account with DBA privileges creates the
‘username' ‘Jasper' with password
‘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:
|
The user Jasper should
be associated with the tenant identified by the domain mtdomain.