Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: First stored procedure

Re: First stored procedure

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 23 Feb 2000 11:56:54 -0500
Message-ID: <p848bscitkm7badov4jdf9tmqh3us50h3n@4ax.com>


A copy of this was sent to kev <kevin.porter_at_fast.no> (if that email address didn't require changing) On Wed, 23 Feb 2000 16:09:57 +0000, you wrote:

>Hi,
>
>I need to make use of stored procedures. Here's my first attempt (using
>SQLPlus), with errors:
>
>SQL> CREATE OR REPLACE PROCEDURE test1
> 2 (
> 3 n IN NUMBER,
> 4 m IN NUMBER
> 5 )
> 6 BEGIN
> 7 INSERT INTO emp (ename, sal) values( 'testing', 1 );
> 8 END test1;
> 9 /
>
>Warning: Procedure created with compilation errors.
>
>SQL> show errors
>Errors for PROCEDURE TEST1:
>
>LINE/COL ERROR
>--------
>-----------------------------------------------------------------
>6/1 PLS-00103: Encountered the symbol "BEGIN" when expecting one of
> the following:
> ; is with authid deterministic parallel_enable as
> The symbol "is" was substituted for "BEGIN" to continue.
>

the parser is telling you "begin" is unexpected. We were expecting something else, one of:

;
is
with
...
as

The procedure should be:

create or replace procedure test1
(
n in number,
m in number
)

AS                           <<<<<------------------------
begin
....

>
>This is obviously advanced Oracle-speak, I don't have a clue what it
>means. Doing a "oerr pls 103" is equally cryptic:
>
>
>[oracle8i_at_blackadder megsoc]$ oerr pls 103
>103,0, "database"
>
>
>Can someone explain please what have I done wrong? And how to fix it?
>
>TIA<
>
>- Kev

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Feb 23 2000 - 10:56:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US