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

Home -> Community -> Mailing Lists -> Oracle-L -> Is least() usable in a function ???

Is least() usable in a function ???

From: Alain Barrette <abarrette_at_STH1.MASKA.NET>
Date: Mon, 12 Feb 1996 07:56:08 +0000
Message-Id: <9602121306.AA03467@alice.jcc.com>


Hi...

We are having difficulties with a quite simple piece of code. Could anyone please try it out on anothers platforms to see if this is generic problem, or just with our version of oracle.

It seem to me that least() is not something that complicated.

So if you could explain why I get an "no data found" error, please do.

If anyone know of a fix (others than using the first version of f1()), please let us know as well.

Here is the offending piece of code.



SQL*Plus: Release 3.1.3.7.2 - Production on Fri Feb 09 15:17:08 1996 Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.

Connected to:
Oracle7 Server Release 7.1.4.3.2 - Production Release With the distributed and parallel query options PL/SQL Release 2.1.4.3.1 - Production

SQL> create or replace function f1(n1 in number, n2 in number) RETURN number IS

  2 begin
  3 if n1<n2 then
  4 return(n1);
  5 else
  6 return(n2);
  7 end if;
  8 end;
  9 /

Function created.

SQL> select f1(1,2) from dual;

   F1(1,2)


         1

SQL> create or replace function f1(n1 in number, n2 in number) RETURN number IS

  2 begin
  3 return(least(n1,n2));
  4 end;
  5 /

Function created.

SQL> select f1(1,2) from dual;
select f1(1,2) from dual

       *
ERROR at line 1:
ORA-01403: no data found

SQL>


       ,,,
      (o o)

--oOOo-(_)-oOOo--abarrette_at_sib.qc.ca
Received on Mon Feb 12 1996 - 08:06:14 CST

Original text of this message

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