Re: problem with stored procedure

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 06 May 2002 23:40:16 GMT
Message-ID: <3CD71459.6952D649_at_exesolutions.com>


Craig Hamilton wrote:

> I am receiving compile errors with the following procedure.
>
> The first errors are: Encountered the symbol "(" when expecting one of
> the following:
> :=.),_at_% default character...
>
> Seems it is looking for defaults...are those necessary?
>
> Any help would be much appreciated.
>
> thanks,
>
> craig
>
> create or replace procedure sample(description in
> varchar2(125),activityid in varchar2(10),
> accomplishments in float, unitofmeasure in varchar2(15),
> workcomments in varchar2(4000),inYear in number(4,0),
> updateuser in varchar2(15), updatetime in date ,
> returnVal out number(15,0))
> AS
> DECLARE
> temp_recordid kcactivity.recordid%TYPE;
> BEGIN
> select kc_actbud_recordid.nextval into temp_recordid from dual;
>
> insert into kcactivity (description,activityid,
> accomplishments,unitofmeasure,
> workcomments,year,
> updateuser,updatedate)
> values (description,activityid,
> accomplishments,unitofmeasure,
> workcomments,inYear,
> updateuser, updatetime)
> END kc_budget_activityplan_insert

No semi-colon after your insert statement or at the END

But while we are on the subject ...

No need for your variable. You could just:

INSERT INTo kcacitvity
(...)
VALUES
(sequence_name.NEXTVAL,...);

And there no commit in the procedure

And there no need for the word DECLARE with or without the variable declaration.

And you have an OUT parameter but it is never used.

In the future when you compile a procedure, or other code, if you get an error type SHO ERR, to see what line it is on.

Hope this helps.

Daniel Morgan Received on Tue May 07 2002 - 01:40:16 CEST

Original text of this message