Solved

Type Casting in oracle

Posted on 2003-11-05
3
1,546 Views
Last Modified: 2008-02-01
How do u type cast in oracle.
I want to convert a decimal value into integer.In Access we have CINT.What is the equivallent in Oracle
0
Comment
Question by:SusanBinoy
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
grim_toaster earned 20 total points
ID: 9685884
There are a number of ways to do this, th simplest of which are:

ceil(76.76)   - returns the smallest integer larger than (or equal) to the value passed (eg 77 in this case).
floor(76.76) - returns the smallest integer smaller than (or equal) to the value passed (eg 76 in this case).
round(76.76, 0) - rounds of the number to the specified precision (the second parameter) (eg 77 in this case).

0
 
LVL 7

Expert Comment

by:grim_toaster
ID: 9685890
Or trunc(76.77, 0) - which truncates the value to the specified precision.
0
 

Author Comment

by:SusanBinoy
ID: 9685929
Thanks Grim that was a quick answer.
It is working I was searching for the answer for a long time
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question