Re: PL/SQL Procedure Problem

From: James <Jimbo_at_yahoo.com>
Date: Wed, 15 Oct 2003 12:11:22 +0000 (UTC)
Message-ID: <bmjdh9$5ds$1_at_hercules.btinternet.com>


[Quoted] "Sybrand Bakker" <gooiditweg_at_nospam.demon.nl> wrote in message news:tocqovk8s4eldbim81h76e6ij83k9pbpfn_at_4ax.com...
> On Wed, 15 Oct 2003 11:16:38 +0000 (UTC), "Jimbo" <Jimbo_at_yahoo.com>
> wrote:
>
> >Hi there, I'm new to PL/SQL and have been given the following procedure:
> >
> >create or replace procedure otime (hoursworked number) as
> >overtimehours number;
> >normalhours number;
> >message varchar2(30);
> >begin
> >normalhours := 35;
> >if hoursworked > normalhours then
> >overtimehours := hoursworked - normalhours;
> >message := 'Overtime Hours worked = ';
> >dbms_output.put_line(message);
> >dbms_output.put_line(overtimehours);
> >else
> >message := 'No Overtime!';
> >dbms_output.put_line(message);
> >end if;
> >end;
> >
> >but when I EXECUTE this, I get an error and I think it is referring to
 the
> >datatype(number) after 'hoursworked' in the 1st line. Could someone give
 me
> >some help on this please?
> >
> >Also, how would I get the data from a column called hours in a table
 called
> >EMP, when using a procedure?
> >
> >Many thanks,
> >James
> >
> >
> >
> If you are also new to this newsgroup, you are advised always to
> include *at least*
> - The exact error message
> - The version and O/S of Oracle you are using.
> The procedure seems to compile, your reference to the way you are
> executing it is so vague, one needs to resort to a crystall ball.
> They have been sold out long since
>

Ok, here is what I receive after entering the command 'EXECUTE otime':

BEGIN otime; END;

      *
ERROR at line 1:

ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'OTIME'
ORA-06550: line 1, column 7:

PL/SQL: Statement ignored

I am using SQL *Plus on Oracle 9i on Windows XP.

I haven't created tables to use with this procedure as I wasn't sure if it was necessary. Received on Wed Oct 15 2003 - 14:11:22 CEST

Original text of this message