Recently ran across this procedure, defined in the Post Authentication field in an Appliation Expression application. I encourage you to look it over and come up with your list of things you'd want to change about it. I leave a whole lot of white space below the code block so you can view the end before seeing what I have to say about it. 1: procedure post_auth_7048783549465082709 is 2: begin 3: APEX_UTIL.RESET_AUTHORIZATIONS; 4: 5: for c1 in ( 6: select count(*) cnt 7: from app_users 8: where username = :APP_USER 9: and role_name = 'ADMINISTRATOR' ) 10: loop 11: if c1.cnt > 0 then 12: :IS_ADMIN := 'TRUE'; 13: else 14: :IS_ADMIN := 'FALSE'; 15: end if; 16: end loop; 17: 18: for c1 in ( 19: select count(*) cnt 20: from app_users 21: where username = :APP_USER 22: and role_name = 'CONTRIBUTOR' ) 23: loop 24: if c1.cnt > 0 then 25: :IS
For the last twenty years, I have managed to transform an obsession with PL/SQL into a paying job. How cool is that?