Create a stored procedure with authid
SQL>
SQL> create table numbers(
2 n number,
3 username varchar2(30) )
4 /
Table created.
SQL>
SQL>
SQL> create or replace
2 procedure insert_numbers( p_num number ) authid current_user as
3 begin
4 insert into numbers values ( p_num, user );
5 end insert_numbers;
6 /
Procedure created.
SQL>
SQL> EXEC insert_numbers(1);
PL/SQL procedure successfully completed.
SQL>
SQL> drop table numbers;
Table dropped.
SQL>
SQL>
Related examples in the same category