how to run the stored procedure
Posted in 1999
Topics: Stored Procedures & SPL
Hi Again,
I've created the procedure to update statistics but now I'm not sure how
to run it. The procedure is really simple :
create procedure updstats()
update statistics high for table table_name;
end procedure;
The question now is 1) How do I run the procedure and 2) How do I give
previliges to another user.
If the procedure was returning something then I wouldn't be asking question
1, but simplicity kills :-)
Thanx a lot
Austin
Austin,
1) To run it, just execute the following SQL:
execute procedure updstats();
2) To grant permission for another user to execute the query, do a:
grant execute on updstats to <username>;
Also, keep in mind with this procedure that the user that is executing this procedure must have permission to do an update statistics. If they don't,
you can create your procedure as a DBA procedure, by saying:
create DBA procedure updstats ...... Then, the stored procedure will execute with DBA permissions instead of the normal user's permissions.
Hope that helps,
--Steven
Austin Castro wrote:
> Hi Again,
> I've created the procedure to update statistics but now I'm not sure how
> to run it. The procedure is really simple :
>
> create procedure updstats()>
> update statistics high for table table_name;>
> end procedure;
>
> The question now is 1) How do I run the procedure and 2) How do I give
> previliges to another user.
>
> If the procedure was returning something then I wouldn't be asking question
> 1, but simplicity kills :-)
>
> Thanx a lot
> Austin
--
-----------------------------------------------------
Steven Mastandrea stevem@cstech.com
Systems Designer 847.397.7300
CSTech, Inc. Schaumburg, IL