Home » SQL & PL/SQL » SQL & PL/SQL » Length of SUM field
Length of SUM field [message #884] Mon, 11 March 2002 05:35 Go to next message
Tina
Messages: 38
Registered: November 2001
Member
Hello there,

I'm having a small problem and thought that someone could help, please?

I'm summing a field with a data type of NUMBER(15,2), but when I sum this field it is only displaying ten characters in length, and therefore cutting off some on the decimals.

I have been trying to sum this field, and use a TO_NUMBER but producing errors. How do I sum this field, but also increase it's length?

Many Thanks
Re: Length of SUM field [message #885 is a reply to message #884] Mon, 11 March 2002 05:40 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
try this

sql> set numwidth 20
Re: Length of SUM field [message #888 is a reply to message #884] Mon, 11 March 2002 06:29 Go to previous messageGo to next message
Tina
Messages: 38
Registered: November 2001
Member
Thank-you this works fine for select statements, but how can I get the same functionality, if I am inserting the sum field into a table, and need to increase the sum field size, as it is only inserting the ten character figure?

Many Thanks
Re: Length of SUM field [message #892 is a reply to message #884] Mon, 11 March 2002 08:46 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
increase sumfield size of table using alter table command.

alter table tab1 modify sumfield number(20,2);
Previous Topic: sql+ alter table constraint syntax
Next Topic: TIMESTAMP-1..HOW??
Goto Forum:
  


Current Time: Wed Apr 24 14:26:38 CDT 2024