Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:23:16+00:00 2026-05-30T05:23:16+00:00

We are trying to modify the precision on existing columns in the database. Those

  • 0

We are trying to modify the precision on existing columns in the database. Those which have been defined as NUMBER, we want to change it to NUMBER(14,2).

But, since NUMBER has a default precision of 38, there exist values in the database which run into more than 10 decimal places. So, when we create an additional column and try to copy over from a temp table, this results in errors.

 select count(*) into countCol from USER_TAB_COLUMNS where TABLE_NAME = 'EVAPP_INTERFACE' and COLUMN_NAME = 'RESERVE_RATE_NUM' and DATA_SCALE is null; 
 IF (countCol <> 0) then   

 execute immediate 'alter table EVAPP_INTERFACE add RESERVE_RATE_NUM_TMP NUMBER(6,3)' ; 

 execute immediate 'update EVAPP_INTERFACE set RESERVE_RATE_NUM_TMP = RESERVE_RATE_NUM' ; 

 execute immediate 'alter table EVAPP_INTERFACE drop column RESERVE_RATE_NUM' ; 

 execute immediate 'alter table EVAPP_INTERFACE rename column RESERVE_RATE_NUM_TMP to RESERVE_RATE_NUM' ; 


 DBMS_OUTPUT.put_line('This column EVAPP_INTERFACE.RESERVE_RATE_NUM has been modified to the required precision');

Is there any way to truncate all values in a column?

Like say a column has

43.8052201822
21.1610909091
76.4761223618
75.8535613657

I want them all changed to

 43.8
 21.16
 76.47
 75.85

EDIT : I know the word Truncate is used wrongly, but I don’t know of a better term to shaving off precision.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:23:17+00:00Added an answer on May 30, 2026 at 5:23 am

    Not a wrong word at all, see: TRUNC(number).

    From the example below you can see the difference of truncating and rounding:

    create table foo(n number);
    
    insert all
    into foo values (1.111)
    into foo values (5.555)
    into foo values (9.999)
    select * from dual;
    
    select n, round(n,2), trunc(n, 2) from foo;
    
             N ROUND(N,2) TRUNC(N,2)
    ---------- ---------- ----------
         1.111       1.11       1.11
         5.555       5.56       5.55
         9.999         10       9.99
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify a table inside my PostgreSQL database, but it says there
I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but
I'm currently trying to modify some HttpWebRequest functions, but I can't do it through
I am trying to modify the controls of a Panel, have it update, then
I've been trying to modify the AuditTrail code so that it does not copy
I'm trying to modify a shopping cart (zencart) to do what I want, so
i've been trying to modify the program so that it could accept more than
I am trying to modify an existing PDF with iText. My code currently edits
I'm trying to modify the contents of one pointer using another. I want string2
I am trying to modify a table within a database, as follows: using (SqlCeCommand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.