grant execute [message #23639] |
Fri, 20 December 2002 08:29 |
Tajeev
Messages: 5 Registered: December 2002
|
Junior Member |
|
|
Look at the following example:
I connected as rajeev@my_db and created a procedure called my_Print. Then I granted executed on my_Print to scott. Then I connected as scott@my_db. But scott cannot execute my_Print. Why?
SQL> CONNECT
Enter user-name: rajeev@my_db
Enter password:
Connected.
CREATE OR REPLACE PROCEDURE my_Print (
inputString VARCHAR2)
AS
BEGIN
IF length(inputString) < 255
THEN
dbms_output.put_line(inputString);
ELSE
dbms_output.put_line('String too long');
END IF;
END;
/
SQL> grant execute on my_Print to scott;
Grant succeeded.
SQL> commit;
SQL> connect
Enter user-name: scott@my_db
Enter password: *****
Connected.
SQL> exec my_Print('My name is Rajeev')
BEGIN my_Print('My name is Rajeev'); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'MY_PRINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
|
|
|
Re: grant execute [message #23640 is a reply to message #23639] |
Fri, 20 December 2002 08:51 |
Arvind
Messages: 23 Registered: December 2001
|
Junior Member |
|
|
Inlcude the schema (user name) to which the procedure belongs
scott> exec rajeev.my_Print('My name is Rajeev')
Arvind
|
|
|
|