Re: Newbie - Creating Stored Procedures???

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 10 Jan 2003 08:13:01 -0800
Message-ID: <3E1EF10D.83830AC3_at_exesolutions.com>


Ronald wrote:

> Hello all, can someone please explain to me how to create stored procedures
> in Oracle8i? thanks a lot.

Start with an anonymous block. The simplest of which is:

BEGIN
   NULL;
END;
/

Then turn it into a stored procedure:

CREATE OR REPLACE PROCEDURE <procedure_name> IS

BEGIN
   NULL;
END <procedure_name>;
/

Then add exception handling:

CREATE OR REPLACE PROCEDURE <procedure_name> IS

BEGIN
   NULL;
EXCEPTION
   WHEN OTHERS THEN
      NULL;
END <procedure_name>;
/

Then declare variables:

CREATE OR REPLACE PROCEDURE <procedure_name> IS

x dual.dummy%TYPE;
i PLS_INTEGER;
y VARCHAR2(20);
l BOOLEAN;

BEGIN
   NULL;
EXCEPTION
   WHEN OTHERS THEN
      NULL;
END <procedure_name>;
/

Replace the NULL's with code and you have the basics.

Daniel Morgan Received on Fri Jan 10 2003 - 17:13:01 CET

Original text of this message