Using the CREATE USER statement, you can only create users in the _User table. Users defined in other user accounts must be created outside of SQL. Use the following syntax to employ the CREATE USER statement:
CREATE USER {'username'|'username@domain_name'}, 'password' ;
Examples: CREATE USER statement
In the following example, an account with DBA privileges creates the 'username' 'GPS' with 'password' 'star'.
CREATE USER 'GPS', 'star';
In the following example, CREATE USER creates the user Jasper to connect to mtdomain domain with the password spaniel:
CREATE USER 'Jasper@mtdomain', 'spaniel' ;
The user Jasper should be associated with the tenant identified by the domain mtdomain.
A user's password can be changed easily by using the ALTER USER statement, as shown:
ALTER USER { 'username'|'username@domain_name' }, 'old_password', 'new_password';
To set a new password without specifying the old password, use the following syntax:
ALTER USER 'username', 'new_password';
Examples: ALTER USER statement
The following example demonstrates the use of the ALTER USER statement:
ALTER USER 'GPS', 'star', 'star1';
The following example demonstrates how to change the password for a user associated with a domain. The following ALTER USER statement changes the password from normandy to brittany for the user Jasper associated with mtdomain domain:
ALTER USER 'Jasper@mtdomain', 'normandy', 'brittany' ;
When users are created, the default DBA (the user who created the database) becomes disabled. It is important to grant DBA privileges to at least one user so you will have a valid DBA account.
For complete details on the CREATE USER statement, see OpenEdge Data Management: SQL Reference.