Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Math in Informix SQL

520 views
Skip to first unread message

V. Lanny Rosicky

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
Is it possible that I cannot locate an arithmetic operator for exponentiation
in SQL ?

I need to do square and root. The solution for square was to wright a stored
procedure and access it as a function i.e. select pow2(a+b) from table. But
I am stuck with square root.

Any ideas ?

V. Lanny Rosicky - la...@terren.com

Sanjay Kumar

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
If u r using 7.11 the functions sqrt and pow(col, n ) are available.

AS in :-
select sqrt(your_col) , pow( your_col, pow_req) from
your_tab ;

HTH
____________
Sanjay Kumar Email: sku...@raileurope.com
Rail Europe Inc.
226 Westchester Ave | Office : (914) 681 3296
White Plains, NY 10604 | Fax : (914) 682 5236


Bob_Baske...@email.sps.mot.com

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
check the Informix Guide to SQL : Syntax manual pages 1-560 through 1-570 for
the math functions. (ABS,MOD,POW,ROOT,ROUND,SQRT,TRUNC,EXP,LOGN,LOG10,HEX).

regards,
bob baskett
_______________________________________________________________________________
Subject: Math in Informix SQL
From: la...@terren.com@smtpsend at #EMAIL
Date: 4/4/96 2:32 PM

Apparently-To: RZB...@email.sps.mot.com

Jonathan Leffler

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
Well, in 6.00 and later versions, at any rate, the mathematical operators
are built-in:
ABS, MOD, POW, ROOT, ROUND, SQRT, TRUNC,
EXP, LOGN, LOG10, HEX,
COS, SIN, TAN, ASIN, ACOS, ATAN, ATAN2

Try them in your version; they were present before they were documented.

Yours,
Jonathan Leffler (jo...@informix.com) #include <disclaimer.h>

Neal Howard

unread,
Apr 5, 1996, 3:00:00 AM4/5/96
to
In article <4k1kfm$h...@cssun.mathcs.emory.edu>,

Jonathan Leffler <jo...@informix.com> wrote:
>Well, in 6.00 and later versions, at any rate, the mathematical operators
>are built-in:
>ABS, MOD, POW, ROOT, ROUND, SQRT, TRUNC,
>EXP, LOGN, LOG10, HEX,
>COS, SIN, TAN, ASIN, ACOS, ATAN, ATAN2
>
>Try them in your version; they were present before they were documented.
>
>Yours,
>Jonathan Leffler (jo...@informix.com) #include <disclaimer.h>
>

How about a random function? To the best of my knowledge there's not
one in 4GL. I've used C function calls in the compiled version but
this doesn't help when you've only got RDS... I guess you'd have to write
your own pseudo random number generator using math functions there.
--
=====================================================================
= Neal Howard ne...@metronet.com '91 XLH-1200 DoD #686 AMA NRA =
= "Fuzzy Wuzzy was a bear, Fuzzy Wuzzy had no hair. If Fuzzy Wuzzy =
= had no hair, then Fuzzy Wuzzy wasn't Fuzzy, wuz he ?!!!" =
= http://www.flash.net/~neal <-------My home page. =
=====================================================================

0 new messages