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: sine and cosine function from plsql

Re: sine and cosine function from plsql

From: Chrysalis <cellis_at_iol.ie>
Date: 1997/09/26
Message-ID: <342BD6F0.2F03@iol.ie>#1/1

Abiy Alemu wrote:
>
> How does the call to sine and cosine functions work in plsql ? I tried
> select cos(value) into variable from dual , with value of number type.
>
> |-----------------------------------------------------------------------------|
> | If the only tool you have is a | Abiy Alemu abiy_at_biotec.jouy.inra.fr |
> | hammer, everything in the world | 9, avenue calmels |
> | seems like a nail.____________________| 92270 Bois colombes (France)________|

-- 

As with any other function supported in PL/SQL (N.B. not decode!)
you can just assign the result to the variable, thus:

declare
   var number;
   val number;
begin
   ...
   var := cos(val);
   ...
end;

(In fact, you should *never* have to "select .. from dual"
 in PL/SQL)

HTH

Chrysalis

FABRICATI DIEM, PVNC
('To Protect and to Serve')
Terry Pratchett : "Guards Guards"
Received on Fri Sep 26 1997 - 00:00:00 CDT

Original text of this message

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