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

Home -> Community -> Usenet -> c.d.o.server -> Re: executing a procedure

Re: executing a procedure

From: Michael Kakuschky <kuschky_at_nikoma.de>
Date: 2000/04/02
Message-ID: <8c88tb$d7q$1@news.nikoma.de>#1/1

You have to get a output variable in the statement because a procedure does not return a result like a function .You must get the result from a output variable.

strmessage varchar2(255);
...
execute spAddUser ('Pete', 'Rose',strmessage); ...
if strmessage ='ORA-2003' Then .....

Louis <frolio_at_videoshare.com> schrieb in im Newsbeitrag: 8c84ok$ojt$1_at_bob.news.rcn.net...
> Greeting All, I have created a simple stored procedure that takes
 arguments
> and
> then writes them to a new record in my user table. Below is the code for
> this procedure:
>
> CREATE OR REPLACE PROCEDURE spAddUser (
> IvcFirstName IN VARCHAR2,
> IvcLastName IN VARCHAR2,
> OvcErrorMessage OUT VARCHAR2
> )
>
> AS
> AppError EXCEPTION;
>
> BEGIN
>
> OvcErrorMessage := 'NO ERROR.';
>
> INSERT INTO VIDEOSHARE.tbUser
> VALUES(
> IvcFirstName,
> IvcLastName
> );
>
> COMMIT;
>
> EXCEPTION
> WHEN OTHERS THEN
> ROLLBACK;
> OvcErrorMessage := 'Error Inserting Record: spAddUser: Pos #1.' ||
> SQLERRM;
> RAISE AppError;
> RETURN;
> END spAddUser;
> /
>
>
> When I try to execute this procedure:
>
> execute spAddUser ('Pete', 'Rose');
>
> I am prompted with the error message:
>
> ERROR at line 1:
> ORA-06550: line 1, column 7:
> PLS-00306: wrong number or types of arguments in call to 'SPADDUSER'
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
>
>
> I think it has to do with my output paramater? Do I need to pass
 something
> to this or
> do I need to default it? Any help would be greatly appreciated.
>
> Louis
>
>
Received on Sun Apr 02 2000 - 00:00:00 CST

Original text of this message

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