Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP ABOUT REMAINDER IN PL/SQL
In article <gt4R5.53008$4U6.2268663_at_news1.rdc2.on.home.com>,
"Andrew Huy Truong" <andrew-htruong_at_home.com> wrote:
> Hi, I have a problem here hoping someone could help me out, I'll be
very
> much appreciated.
> I need to know the symbol for a REMAINDER of a number, for example, 5
divide
> by 2, then the remainder would be 1. Or if 8 divide 3 then the
remainder
> would be 2 and so on...
> I know in C language the symbol is %.
> like 5 % 2;
> I'd like to know this symbol for PL/SQL or SQL plus, or if you can
let me
> know the formula that would calculate the same result.
>
> Thanks a bunch.
> my email is andrew-htruong_at_home.com
> Andrew.
>
> I am doing this assignment for a class and I required to:
>
> write a function convert_into_words tht takes in number value and
returns
> the same number into words (take number from 1 to 99) for example: if
1 is
> passed then 'one' is returned, or 5 is passed, then 'five' is
returned.
>
> I cannot use any bulit in function.
>
>
Use built-in fuction MOD.
SQL> select MOD(5,2) from dual;
MOD(5,2)
1
Lev Smirnov
Brainbench MVP for Oracle Admin
http://www.brainbench.com
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 17 2000 - 02:34:49 CST