CREATE USER

Syntax

For creating an External Username:

CREATE USER external-user-name FOR guardian-user-name;

For adding one or more Guardian usernames to the user management metadata:

CREATE USER FOR (guardian-user-name [, guardian-user-name] ...);

Description

Use the CREATE USER statement to create an External Username for a Guardian user, or to add Guardian usernames to the user management metadata. You can associate only one External Username with a Guardian username. The user information is stored into the metadata. After executing this command, you can use the External Username instead of Guardian username in any GRANT, REVOKE, or GIVE statements. The metadata for the system catalog must be 3500 or higher.

Parameters

external-user-name
is the external name for the Guardian user.
guardian-user-name
is the Guardian username.
NOTE:

Access to SQL/MX objects follows the rules of the ANSI/ISO/IEC 9075:1999 SQL standard (SQL:1999). SQL:1999 uses authorization IDs to identify users during the processing of SQL statements. A SQL/MX authorization ID is either a valid Guardian username, enclosed in double quotes or the special authorization ID, PUBLIC, or DB_PUBLIC.

Each user authorized to log on to a node is identified by a Guardian user ID that consists of a group and user identification. The user ID has one of these forms: group_number,user_number or group_name.user_name.

Considerations

  • For External Username
    • The External Username cannot have the same format as a valid Guardian username or any special authorization IDs PUBLIC, DB_PUBLIC, or SYSTEM.

    • The External Username cannot contain spaces.

    • You can associate only one External Username with a Guardian username.

Authorization Requirements

To create an External Username for any Guardian user, you must be a security administrator or the Super ID (if Super ID is a part of the Security Administrator’s group or if no Security Administrator’s group exists).

Example Command

  • To create an External Username and associate it with a Guardian username:

    CREATE USER "EMEA\Customer" FOR "DBUSERS.ADMIN";
  • To add Guardian usernames to user management metadata:

    CREATE USER FOR ("SALES.JANE", "PAYROLL.JOE");