Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Arguments Source

CREATE_FIRST_ORG

Arguments:

NameData TypeDefault ValueIn/Out
NAME_INVARCHAR2 IN
PASSWORD_INVARCHAR2 IN
DDL script

Source

Legend: comment string keyword reserved word operator
     1: procedure
     2: create_first_org
     3: (
     4: 	name_in in varchar2,
     5: 	password_in in varchar2
     6: ) is
     7: 	ug_type			number;
     8: 	group_val		number;
     9: begin
    10: 	insert into web_customer (
    11: 		id, name, password,
    12: 		oracle_customer_id, oracle_customer_number,
    13: 		customer_type
    14: 	) values (
    15: 		1, name_in, password_in,
    16: 		1, 1, 'B'
    17: 	);
    18: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    19: 	select	id
    20: 	into	ug_type
    21: 	from	rhnUserGroupType
    22: 	where	label = 'org_admin';
    23: 	insert into rhnUserGroup (
    24: 		id, name,
    25: 		description,
    26: 		max_members, group_type, org_id
    27: 	) values (
    28: 		group_val, 'Organization Administrators',
    29: 		'Organization Administrators for Org ' || name_in || ' (1)',
    30: 		NULL, ug_type, 1
    31: 	);
    32: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    33: 	select	id
    34: 	into	ug_type
    35: 	from	rhnUserGroupType
    36: 	where	label = 'org_applicant';
    37: 	insert into rhnUserGroup (
    38: 		id, name,
    39: 		description,
    40: 		max_members, group_type, org_id
    41: 	) VALues (
    42: 		group_val, 'Organization Applicants',
    43: 		'Organization Applicants for Org ' || name_in || ' (1)',
    44: 		NULL, ug_type, 1
    45: 	);
    46: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    47: 	select	id
    48: 	into	ug_type
    49: 	from	rhnUserGroupType
    50: 	where	label = 'system_group_admin';
    51: 	insert into rhnUserGroup (
    52: 		id, name,
    53: 		description,
    54: 		max_members, group_type, org_id
    55: 	) values (
    56: 		group_val, 'System Group Administrators',
    57: 		'System Group Administrators for Org ' || name_in || ' (1)',
    58: 		NULL, ug_type, 1
    59: 	);
    60: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    61: 	select	id
    62: 	into	ug_type
    63: 	from	rhnUserGroupType
    64: 	where	label = 'activation_key_admin';
    65: 	insert into rhnUserGroup (
    66: 		id, name,
    67: 		description,
    68: 		max_members, group_type, org_id
    69: 	) values (
    70: 		group_val, 'Activation Key Administrators',
    71: 		'Activation Key Administrators for Org ' || name_in || ' (1)',
    72: 		NULL, ug_type, 1
    73: 	);
    74: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    75: 	select	id
    76: 	into	ug_type
    77: 	from	rhnUserGroupType
    78: 	where	label = 'channel_admin';
    79: 	insert into rhnUserGroup (
    80: 		id, name,
    81: 		description,
    82: 		max_members, group_type, org_id
    83: 	) values (
    84: 		group_val, 'Channel Administrators',
    85: 		'Channel Administrators for Org ' || name_in || ' (1)',
    86: 		NULL, ug_type, 1
    87: 	);
    88: 	select rhn_user_group_id_seq.nextval into group_val from dual;
    89: 	select	id
    90: 	into	ug_type
    91: 	from	rhnUserGroupType
    92: 	where	label = 'satellite_admin';
    93: 	insert into rhnUserGroup (
    94: 		id, name,
    95: 		description,
    96: 		max_members, group_type, org_id
    97: 	) values (
    98: 		group_val, 'Satellite Administrators',
    99: 		'Satellite Administrators for Org ' || name_in || ' (1)',
   100: 		NULL, ug_type, 1
   101: 	);
   102: 	insert into rhnOrgQuota(
   103: 		org_id, total
   104: 	) values (
   105: 		1, 1024*1024*1024*16
   106: 	);
   107:         insert into rhnServerGroup
   108: 		( id, name, description, max_members, group_type, org_id )
   109: 		select rhn_server_group_id_seq.nextval, sgt.name, sgt.name,
   110: 			0, sgt.id, 1
   111: 		from rhnServerGroupType sgt
   112: 		where sgt.label = 'sw_mgr_entitled';
   113: end create_first_org;