Call USER to get the name of current user : USER « SQL PLUS Session Environment « Oracle PL/SQL Tutorial






SQL> create or replace function authorized_emps
  2  (
  3      p_schema_name    in varchar2,
  4      p_object_name    in varchar2
  5  )
  6  return varchar2
  7  is
  8     l_deptno      number;
  9     l_return_val  varchar2(2000);
 10  begin
 11     if (p_schema_name = USER) then
 12        l_return_val := null;
 13     else
 14        l_return_val := sys_context('DEPT_CTX','DEPTNO_LIST');
 15     end if;
 16     return l_return_val;
 17  end;
 18  /

Function created.

SQL>








29.59.USER
29.59.1.Authorize user in stored procedure
29.59.2.Call USER to get the name of current user