Create procedure with authid : Procedure Definition « Stored Procedure Function « Oracle PL / SQL






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

1.Creat an empty procedure
2.replace a procedure
3.Create a stored procedure and how to call it.
4.Define procedure to insert data
5.Define and call procedure
6.Create a stored procedure with authid
7.Mutually exclusive local subprograms.
8.A forward declaration.
9.Inner procedure
10.Save calculation result to a table in procedure
11.exception throwed out of the procedure
12.AUTHID clause in a CREATE PROCEDURE statement indicates that this procedure is being created with user's or invoker's rights
13.Increase gift price
14.A local subprogram within a stored procedure
15.Overloaded local procedures: number and varchar2
16.Using all the default values
17.Forward Referencing
18.Mark procedure with authid current_user
19.Reference package variable in a procedure
20.Only manager can change the password