|
Re: Privileges on create procedure [message #436867 is a reply to message #436866] |
Tue, 29 December 2009 04:24 |
|
ramoradba
Messages: 2457 Registered: January 2009 Location: AndhraPradesh,Hyderabad,I...
|
Senior Member |
|
|
SQL> conn system/tejajun20@satya
Connected.
SQL> create user test_orafaq identified by tejajun20 account unlock;
User created.
SQL> grant create session to test_orafaq;
Grant succeeded.
SQL> conn test_orafaq/tejajun20
Connected.
SQL> desc rev
ERROR:
ORA-04043: object rev does not exist
SQL> create or replace procedure rev(x in varchar2) as
2 c char(1);
3 i number;
4 begin
5 for i in 1..length(x) loop
6 select substr(x,length(x)-i+1,1) into c from dual;
7 dbms_output.put(c);
8 end loop;
9 dbms_output.put_line(' ');
10 end;
11 /
create or replace procedure rev(x in varchar2) as
*
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn system/tejajun20
Connected.
SQL> grant create procedure to test_orafaq;
Grant succeeded.
SQL> conn test_orafaq/tejajun20
Connected.
SQL> create or replace procedure rev(x in varchar2) as
2 c char(1);
3 i number;
4 begin
5 for i in 1..length(x) loop
6 select substr(x,length(x)-i+1,1) into c from dual;
7 dbms_output.put(c);
8 end loop;
9 dbms_output.put_line(' ');
10 end;
11 /
Procedure created.
SQL> desc rev
PROCEDURE rev
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
X VARCHAR2 IN
SQL> exec rev('SRIRAM');
PL/SQL procedure successfully completed.
SQL> set serveroutput on
SQL> exec rev('SRIRAM');
MARIRS
PL/SQL procedure successfully completed.
SQL>
For more info Read this....system_privs
[Updated on: Tue, 29 December 2009 04:26] Report message to a moderator
|
|
|
Re: Privileges on create procedure [message #436868 is a reply to message #436867] |
Tue, 29 December 2009 04:40 |
Hitman11
Messages: 94 Registered: October 2009 Location: norway
|
Member |
|
|
Thanks for explaining with examples.
I have one more question to ask.
I created a procedure 'PROC_1' in my schema 'DRAM'. I want to grant
CREATE PROCEDURE,execute procedure privileges to other users.Can you tell me how to grant those ?
or
Is this correct ?
show user
dram
SQL>grant create procedure,execute procedure to A; (other user)
grant succeed
Thanks
|
|
|
|
|
|