Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to: Stored Procedure / Package
On 20 Jun 1997 03:02:18 GMT, "Larry Schenavar" <lorenzo_at_gate.net> wrote:
>Hello,
>
>At this time I have a series of four update queries that I kick off from
>the command scheduler in NT. I'd like to put them in a stored procedure or
>package. What syntax do I use to create the procedure package?
>
>Something like this????????
>
>Create or replace procedure EP_PRO
>
> UPDATE INTO ...
> WHERE ...;
>
> UPDATE INTO ...
> WHERE ...;
>
> UPDATE INTO ...
> WHERE ...;
>
>End EP_PRO;
>
>
As an example, the following statement, taken from the Oracle7 SQL Reference Manual, creates the procedure CREDIT in the schema SAM:
CREATE PROCEDURE sam.credit (acc_no IN NUMBER, amount IN NUMBER)
AS BEGIN
UPDATE accounts
SET balance = balance + amount
WHERE account_id = acc_no;
END;
Thanks!
Joel
Joel R. Kallman Enabling the Information Age through Oracle Government Network Computing! Bethesda, MD http://govt.us.oracle.com jkallman@us.oracle.com http://www.oracle.com