602SQL Documentation Index  

CREATE GROUP Statement

statement_CREATE_GROUP ::= CREATE [ IF NOT EXISTS ] GROUP group_name

Description

The CREATE GROUP statement creates a new user group of the specified name on the server.

The maximum length of a group name is 31 characters. Each group must have a unique name in the database context. If the specified group name exists, and the IF NOT EXISTS clause is specified, the statement will not execute, otherwise the error sqlstate 40004 (KEY_DUPLICITY) will occur.

Groups can be created by security or configuration administrators or by those users that have been granted the privilege to do so by these administrators.

Example:

Create user XUSER with password X, create group XGROUP, and assign the user to the group.

CREATE USER xuser PASSWORD 'x';

CREATE GROUP xgroup;
CALL Set_membership('xuser', CATEG_USER, 'xgroup', CATEG_GROUP, TRUE);

See