Create an Allocation User


PT :  Alloc User
EN : Alloc User


alter session set current_schema = &&rms_schema

INSERT INTO ALC_USERS (USER_ID,USER_NAME,USER_PASSWORD,FIRST_NAME,LAST_NAME,MIDDLE_INITIAL,USER_TYPE,LANGUAGE,COUNTRY)
VALUES  (ALC_USERS_SEQ.NEXTVAL,'ACCSERV2','JackButlandGK23','Leanne Hodgson','Hodgson',NULL,'A','EN','US');

commit;

-- associate departments
declare
    cursor c_deps is select dept from deps;
alloc_user_id alc_users.user_id%type;

begin

select user_id into alloc_user_id from alc_users  where user_name  = 'ACCSERV2';

    for  c1 in c_deps
    loop
            insert into alc_user_depts(user_depts_id,user_id,dept)
            values (alc_user_depts_seq.nextval,alloc_user_id,c1.dept);
     
    end loop;
end;

commit;

Comments