How to use these functions in SQL
1.compose
2.Decompose
3.Remainder
4. chr
5.bit_into_num
4 3962
1. Compose function accepts a string and returns unicode string
The syntax for the compose function is:
compose( string )
string is the input value used to create the Unicode string. It can be a char, varchar2, nchar, nvarchar2, clob, or nclob.
Eg: SELECT COMPOSE('String') FROM DUAl;
2. In Oracle/PLSQL, the decompose function accepts a string and returns a Unicode string.
The syntax for the decompose function is:
decompose( string )
string is the string that will be decomposed.
Eg: SELECT DECOMPOSE('String') FROM DUAL;
3. In Oracle/PLSQL, the remainder function returns the remainder of m divided by n.
The syntax for the remainder function is:
remainder( m, n )
Note:
The remainder function is NEW to Oracle 10! In older versions of Oracle, try using the mod function.
4. CHR function is used to return the character value for the particular ASCII number.
Eg: SELECT CHR(97) FROM DUAL -- This will return alphabet 'a' (Lower case)
SELECT ASCII('a') FROM DUAL -- This will return 97 becuase ASCII value for 'a' is 97
the number functions MOD and REMAINDER might look synonyms of each other ,but in reality they are totally different. they are designed for different purposes.
check the sample example - select mod(100,3) from dual;
-
select remainder(100,3) from dual;
-
-
-
select mod(101,3) from dual;
-
select remainder(101,3) from dual;
-
hope that is much clear now.
Hi Debasis,
Please mention about difference between MOD and REMAINDER functions because I am not able to execute REMAINDER function in 9i.It is supported from 10G.
Thanks
Amit
REMAINDER returns the remainder of m divided by n.
This function takes as arguments any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. Oracle determines the argument with the highest numeric precedence, implicitly converts the remaining arguments to that datatype, and returns that datatype.
The MOD function is similar to REMAINDER except that it uses FLOOR in its formula, whereas REMAINDER uses ROUND
1.If n = 0 or m = infinity, then Oracle returns
An error if the arguments are of type NUMBER NaN if the arguments are BINARY_FLOAT or BINARY_DOUBLE.
2.If n != 0, then the remainder is m - (n*N) where N is the integer nearest m/n.
3.If m is a floating-point number, and if the remainder is 0, then the sign of the remainder is the sign of m. Remainders of 0 are unsigned for NUMBER values. NaN----NotANumber. Sign in to post your reply or Sign up for a free account.
Similar topics
by: hokiegal99 |
last post by:
A few questions about the following code. How would I "wrap" this in a
function, and do I need to?
Also, how can I make the code smart enough to realize that when a file
has 2 or more bad...
|
by: David MacQuigg |
last post by:
I'm not getting any feedback on the most important benefit in my
proposed "Ideas for Python 3" thread - the unification of methods and
functions. Perhaps it was buried among too many other less...
|
by: Rubén Campos |
last post by:
I haven't found any previous message related to what I'm going to ask here,
but accept my anticipated excuses if I'm wrong.
I want to ask about the real usefulness of the 'inline' keyword. I've...
|
by: cwdjrxyz |
last post by:
Javascript has a very small math function list. However there is no
reason that this list can not be extended greatly. Speed is not an
issue, unless you nest complicated calculations several levels...
|
by: Bryan Olson |
last post by:
The current Python standard library provides two cryptographic
hash functions: MD5 and SHA-1 . The authors of MD5 originally
stated:
It is conjectured that it is computationally infeasible to...
|
by: Tim ffitch |
last post by:
Hi
I have created a VB dll file that contains common functions I use
across various projects in VB, Access and Excel. Rather than have to
code the functions in each I decided to use the dll...
|
by: Timothy Madden |
last post by:
Hello all.
I program C++ since a lot of time now and I still don't know this simple
thing: what's the problem with local functions so they are not part of
C++ ?
There surely are many people...
|
by: v4vijayakumar |
last post by:
Why we need "virtual private member functions"? Why it is not an
(compile time) error?
|
by: Immortal Nephi |
last post by:
My project grows large when I put too many member functions into one
class. The header file and source code file will have approximately
50,000 lines when one class contains thousand member...
|
by: KevinADC |
last post by:
This snippet of code provides several examples of programming techniques that can be applied to most programs.
using hashes to create unique results
static variable
recursive function...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |