Home » SQL & PL/SQL » SQL & PL/SQL » executing Procedure problem
executing Procedure problem [message #7867] Mon, 14 July 2003 02:54 Go to next message
Abu Arbab
Messages: 13
Registered: June 2003
Junior Member
I am trying to execute the procedure using toad. when i execute the statements using begin ,end command thru toad as following it is working fine:-
begin
EXECUTE IMMEDIATE 'drop materialized view QAP_MS_VIEW';
EXECUTE IMMEDIATE 'create materialized view QAP_MS_VIEW as select * from QAP_document ';
EXECUTE IMMEDIATE' grant select on QAP_MS_VIEW to qry_lims';
end ;
but when i put the same statements in the procedure as mentioned below and try to execute the procedure it is giving an error insufficient privileges
command

CREATE OR REPLACE procedure qap_run_MT_View
as
BEGIN
EXECUTE IMMEDIATE 'drop materialized view QAP_MS_VIEW';
EXECUTE IMMEDIATE 'create materialized view QAP_MS_VIEW as select * from QAP_document ';
EXECUTE IMMEDIATE' grant select on QAP_MS_VIEW to qry_lims';
END;
/
please any one can advise
thanks
Re: executing Procedure problem [message #7870 is a reply to message #7867] Mon, 14 July 2003 05:07 Go to previous messageGo to next message
Abu Arbab
Messages: 13
Registered: June 2003
Junior Member
Please I have made above procedure to recrate materialized view because i am not able to refresh it because the rewrite query option is not installed in the server.
Thanks
Re: executing Procedure problem [message #7871 is a reply to message #7870] Mon, 14 July 2003 05:16 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Grants should be made directly to the user and not through a role for usage in a Stored Procedure. Perhaps that can be your problem.

MHE
Re: executing Procedure problem [message #7872 is a reply to message #7871] Mon, 14 July 2003 05:36 Go to previous messageGo to next message
Abu Arbab
Messages: 13
Registered: June 2003
Junior Member
Hi MHE

I am executing procedure from the same schema which is the owner of the procedure. other procedures are working fine but I am not executing any ddl thu the procedure.
Thanks
Re: executing Procedure problem [message #7873 is a reply to message #7872] Mon, 14 July 2003 06:11 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
The same rules apply for system privileges (CREATE VIEW, DROP VIEW...).

MHE
Previous Topic: Primary Key
Next Topic: FRM-40508/ORA-00001
Goto Forum:
  


Current Time: Thu May 09 10:43:18 CDT 2024