Re: Help on procedure builder
Date: Wed, 22 Dec 1999 14:34:40 GMT
Message-ID: <83qni1$l8a$1_at_nnrp1.deja.com>
In article <yxR74.33910$Dk.440856_at_news1.mia>,
"Tom Deseamus" <tdeseamus_at_digital-hire.com> wrote:
> Newbie question:
>
> I've set up a package spec, package body with one procedure and one
separate
> procedure:
<SNIP>
> Procedure
>
> PROCEDURE UPROD IS
> BEGIN
> UPDATE PRODUCT
> SET DESCRIPTION = 'TEST'
> WHERE
> PRODUCT_ID = 100890;
> END;
>
> All information is stored in the schema DEMO. I try to run the
procedure
> UP_PRODUCT as follows and get the error message below.
>
> SQL> EXECUTE UP_PRODUCT;
>
> BEGIN UP_PRODUCT; END;
>
> *
> ERROR at line 1:
> ORA-06550: line 1, column 7:
> PLS-00201: identifier 'UP_PRODUCT' must be declared
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
> SQL>
>
> When I try to run the procedure uprod, I get the following error.
>
> SQL> execute uprod;
> BEGIN uprod; END;
>
> *
> ERROR at line 1:
> ORA-06550: line 1, column 7:
> PLS-00201: identifier 'UPROD' must be declared
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
> SQL>
>
> Any help would be greatly appreceated
The procedure UP_PRODUCT is part of the package, so you need to include the package name when you refer to it.
BEGIN
UPDATE_PRODUCT.UP_PRODUCT;
END;
For the procedure, you need to put the CREATE command ahead of the
PROCEDURE keyword in order to store the procedure in the database.
In fact, put CREATE OR REPLACE before PROCEDURE in your scripts to make
it easier when you make changes to your procedures. Otherwise, the
second time you CREATE PROCEDURE UPROD, Oracle will complain that the
object already exists, and you'll have to DROP it before you can create
it again. CREATE OR REPLACE handles both new creates and new versions.
Howard Parks
1 Peter 4:10
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Dec 22 1999 - 15:34:40 CET