Home » RDBMS Server » Security » grant execute
grant execute [message #23639] Fri, 20 December 2002 08:29 Go to next message
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 Go to previous messageGo to next message
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
Re: grant execute [message #24281 is a reply to message #23639] Wed, 05 February 2003 15:11 Go to previous message
Mark
Messages: 284
Registered: July 1998
Senior Member
exec <user>.my_Print('My name is Rajeev')
Previous Topic: Oracle role question.
Next Topic: Roles Question
Goto Forum:
  


Current Time: Thu May 19 01:19:46 CDT 2022