Procedure for current user : Object Privileges « User Privilege « Oracle PL/SQL Tutorial






SQL>
SQL> create table t ( msg varchar2(25), c1 int, c2 int );

Table created.

SQL>
SQL> insert into t values ( 'c1=1, c2=2', 1, 2 );

1 row created.

SQL>
SQL> create or replace procedure P
  2  authid current_user
  3  as
  4  begin
  5      for x in ( select * from t ) loop
  6                  dbms_output.put_line( 'msg= ' || x.msg );
  7                  dbms_output.put_line( 'C1 = ' || x.c1 );
  8                  dbms_output.put_line( 'C2 = ' || x.c2 );
  9      end loop;
 10  end;
 11  /

Procedure created.

SQL>
SQL> exec p
msg= c1=1, c2=2
C1 = 1
C2 = 2

PL/SQL procedure successfully completed.

SQL>








36.5.Object Privileges
36.5.1.Object Privileges
36.5.2.Granting Object Privileges to a User
36.5.3.Use the GRANT option to enable a user to grant a privilege to another user
36.5.4.Revoking Object Privileges
36.5.5.Grant a procedure to public and then execute it
36.5.6.Procedure for current user