CREATE USER

 

Function

The CREATE USER statement establishes a user as a prerequisite to having access.

 
Syntax
create_user.bmp
 

user_identifier

A unique identifier for a user.

password

A valid password string with a maximum length of 20 bytes.

schema_identifier

A valid default schema identifier.

  

Description

CREATE USER defines a user with an optional password and optional character set. If a password has been specified, the user must enter it to gain access to the system. If no password has been specified, this user will have no password protection.

The SCHEMA option has an effect on the setting of the default schema after the user's CONNECT. The default is equal to the user identifier. If the schema does not already exist, it is created implicitly with the specified user as owner.

The CHARACTER SET option defines a default character set which is used when the user connects to the server without specifying a character set explicitly. The default is 'US-ASCII'.

All settings specified here can be changed later using the ALTER USER statement.

Note: The password to be provided is visible in this statement. It will then be encrypted internally.

 
Limitations

Only the DBA may execute this statement.

The user identifier must be unique.

Caution: This statement is not subject to transaction logic. An implicit COMMIT will be performed after successful execution of this statement. If an error is detected during execution of this statement, an implicit ROLLBACK will be performed. Therefore, before executing this statement, it is strongly recommended to complete any open transaction containing INSERT, UPDATE and/or DELETE statements by issuing an explicit COMMIT or ROLLBACK statement.

 
ANSI Specifics

The CREATE USER statement is not part of the Standard.

 
CONNX Specifics

None

 

Example

The following example defines the user TIM with a password and a schema.

 

CREATE USER 'TIM' PASSWORD '&M%I?T' SCHEMA 'TIM';
 

In order to create users, you must be a database administrator. Database administrators are identified in the CONNX CDD as members of the group CONNXCDDAdministrators.

image19.gif