text: CREATE OR REPLACE procedure GET_ALL_ROLES_FOR_USER
     ( AW_USER_ID IN osp$user.user_id%TYPE,
       cur_generic IN OUT result_sets.cur_generic) is
  
  begin
  
  open cur_generic for
  SELECT   OSP$USER_ROLES.ROLE_ID,
           OSP$ROLE.ROLE_NAME,
  	 		OSP$ROLE.ROLE_TYPE ,
  			OSP$ROLE.STATUS_FLAG,
           OSP$UNIT.UNIT_NAME,
  		 OSP$UNIT.UNIT_NUMBER
      FROM OSP$USER_ROLES   ,
  			 OSP$ROLE ,
  			OSP$UNIT
     WHERE UPPER(OSP$USER_ROLES.USER_ID) = UPPER(AW_USER_ID)
       AND OSP$USER_ROLES.ROLE_ID = OSP$ROLE.ROLE_ID
  	  AND OSP$UNIT.UNIT_NUMBER = OSP$USER_ROLES.UNIT_NUMBER
     ORDER BY OSP$USER_ROLES.UNIT_NUMBER,
              OSP$ROLE.ROLE_TYPE,
  		      OSP$ROLE.ROLE_NAME
  ;
  
  end;
  /
  
  