MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sum columns defined as CHAR

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Wed Jun 02, 2004 12:40 pm    Post subject: sum columns defined as CHAR Reply with quote

Hi all,

can we do aritmetics operational with columns defined as a CHAR?

I've been testing and i know that:

SELECT SUM(DECIMAL('column name'))

works.

But, is there any risk? Shall i consider something before to create the columns?

Kind regards.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Jun 02, 2004 12:49 pm    Post subject: Reply with quote

monaco,

The answer depends on the data you are trying to insert into the db2 column.If you are sure that you will only insert numeric values then you can change the column definition to decimal or Integer.

Using decimal or integer fucntion on character data involves the conversion routine to be invoked and this might effect the performance in the long run.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group