Create procedure with authid
SQL>
SQL> create or replace procedure show_objects
2 authid current_user as
3 begin
4 for c1 in (select object_name, object_type from user_objects where rownum < 50
5 order by object_name ) loop
6 dbms_output.put_line('Name: ' || c1.object_name || ' Type: ' || c1.object_type );
7 end loop;
8 end;
9 /
Procedure created.
SQL> set serveroutput on
SQL> exec show_objects
Name: BOOTSTRAP$ Type: TABLE
Name: CCOL$ Type: TABLE
Name: CDEF$ Type: TABLE
Name: CLU$ Type: TABLE
Name: COL$ Type: TABLE
Name: CON$ Type: TABLE
Name: C_COBJ# Type: CLUSTER
Name: C_FILE#_BLOCK# Type: CLUSTER
Name: C_OBJ# Type: CLUSTER
Name: C_TS# Type: CLUSTER
Name: C_USER# Type: CLUSTER
Name: FET$ Type: TABLE
Name: FILE$ Type: TABLE
Name: ICOL$ Type: TABLE
Name: IND$ Type: TABLE
Name: I_CCOL1 Type: INDEX
Name: I_CDEF1 Type: INDEX
Name: I_CDEF2 Type: INDEX
Name: I_CDEF4 Type: INDEX
Name: I_COBJ# Type: INDEX
Name: I_COL2 Type: INDEX
Name: I_COL3 Type: INDEX
Name: I_CON1 Type: INDEX
Name: I_CON2 Type: INDEX
Name: I_FILE#_BLOCK# Type: INDEX
Name: I_FILE1 Type: INDEX
Name: I_FILE2 Type: INDEX
Name: I_IND1 Type: INDEX
Name: I_OBJ# Type: INDEX
Name: I_OBJ1 Type: INDEX
Name: I_OBJ2 Type: INDEX
Name: I_OBJ3 Type: INDEX
Name: I_PROXY_DATA$ Type: INDEX
Name: I_PROXY_ROLE_DATA$_1 Type: INDEX
Name: I_TAB1 Type: INDEX
Name: I_TS# Type: INDEX
Name: I_TS1 Type: INDEX
Name: I_UNDO1 Type: INDEX
Name: I_UNDO2 Type: INDEX
Name: I_USER1 Type: INDEX
Name: OBJ$ Type: TABLE
Name: PROXY_DATA$ Type: TABLE
Name: PROXY_ROLE_DATA$ Type: TABLE
Name: SEG$ Type: TABLE
Name: TAB$ Type: TABLE
Name: TS$ Type: TABLE
Name: UET$ Type: TABLE
Name: UNDO$ Type: TABLE
Name: USER$ Type: TABLE
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL>
Related examples in the same category