1 Reply Latest reply: Feb 6, 2013 2:27 AM by Amatu Allah Neveen Ebrahim RSS

    To show list item dynamically with condition

    user9024640
      Dear All,

      I have a non database column named USERTYPE and a database column named USERNAME .I want selecting USERTYPE from the list the USERNAME list should be changed according to the requirement. I applied the following code on KEY-NEXT-ITEM trigger on USERTYPE but this is not working.Please provide me the solution.

      declare
           
           v_rec           recordgroup;
           vstatus      number;
           v_check      recordgroup;
           ENORDI           VARCHAR2(1);     

      BEGIN
           :SYSTEM.Message_Level :=5;
           v_check := find_group('v_rec');

           IF NOT ID_NULL(v_check) THEN
                delete_group(v_check);
           END IF;

           IF :AUDIT.USERTYPE='DBA' THEN      

      v_rec:=CREATE_GROUP_FROM_QUERY('v_rec','SELECT ALL DBA_ROLE_PRIVS.GRANTEE "USERNAME"
      FROM DBA_ROLE_PRIVS
      WHERE (DBA_ROLE_PRIVS.GRANTED_ROLE = ''DBA''
      AND DBA_ROLE_PRIVS.GRANTEE NOT IN (''SYS'', ''SYSTEM'', ''ABABIL_POPUP'')) ORDER BY DBA_ROLE_PRIVS.GRANTEE');
           
      ELSE
           
      v_rec:=CREATE_GROUP_FROM_QUERY('v_rec','SELECT ALL DBA_USERS.USERNAME
           FROM DBA_USERS
           WHERE DBA_USERS.PROFILE = ''TRANSACTION_PROFILE''
           ORDER BY DBA_USERS.USERNAME ');
                     
           END IF;
           
      if not id_null(v_rec) then
           
           vstatus := populate_group(v_rec);
           populate_list('AUDIT.USERNAME',v_rec);
           
      end if;      

           exception
           when others then null;

           END;


      Thanks

      Arif

      Edited by: user9024640 on Feb 5, 2013 11:54 PM