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: please help me out...

Re: please help me out...

From: M <noreply_at_noreply.com>
Date: Sat, 10 May 2003 16:41:38 +0800
Message-ID: <b9iepk$29gp$1@news.hgc.com.hk>


"execute shipfunct(179, U)" can be used if "shipfunct" is a procedure. Since it is a function,
try "select shipfunct(179, 'U') from dual;" in SQL*Plus. Note that the parameter U need to be quoted.

"Oracle_learner" <grad_ra_at_yahoo.com> wrote in message news:4ca14853.0305100038.524bc920_at_posting.google.com...
> hello people,
> I am new to PL/SQL and i have a question. I have a function
> shipfunct(item_no integer, shiptype char) which is as:
> create or replace function shipfunct (item_no integer, shiptype char)
> return number is
> price number;
> itemprice number;
> invalid exception;
> begin
> price := 0;
> select lastbid into itemprice from ITEMS where INO=item_no;
> if(shiptype='U') then
> price := itemprice * 0.1;
> elsif(shiptype='P') then
> price := itemprice * 0.02;
> else raise invalid;
> end if;
> return price;
> exception
> when NO_DATA_FOUND then
> raise_application_error(-20010, 'Item number ' ||
> to_char(item_no) || ' does not exists.');
> when invalid then raise_application_error(-20011,
> 'SHIPTYPE is invalid.');
> end shipfunct;
> /
> how do i execute this. I say execute shipfunct(179, U). But I get this
> error:
> ERROR at line 1:
> ORA-06550: line 1, column 7:
> PLS-00306: wrong number or types of arguments in call to 'SHIPFUNCT
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored

>

> please help me solve this. I run Oracle 8i on a standalone Windows NT.
> help truly appreciated.
> Oracle_learner.
Received on Sat May 10 2003 - 03:41:38 CDT

Original text of this message

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