IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is it possible.... Decimal(5,2) or (7,3)


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreenigacc

New User


Joined: 16 Oct 2007
Posts: 15
Location: bangalore

PostPosted: Mon Oct 29, 2007 1:02 pm
Reply with quote

Hi All,

Could you please let me know that, Is it possible to declare the datatype(DECIMAL) in DB2 as shown below

salary decimal(5,2) or (6,2)

i) is it possible to declare ?
ii) if yes, what's the meaning of the above declaration ?

Thanks in advance
Sreenivasulu G
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Oct 29, 2007 1:17 pm
Reply with quote

Hi There,

Yeap u can declare

Code:
SALARY      DECIMAL(5, 2)

it means it can store upto 5 digit 3 befor precion & 2 after precion

OR
Code:

SALARY      DECIMAL(6, 2)


it means it can store upto 6 digit 4 befor precion & 2 after precion.
Please refer the manual for data type supportrd in DB2
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Tue Oct 30, 2007 11:16 pm
Reply with quote

Are you asking if a same column can be defined like decimal(5,2) or (6,2) ????
pls be more clear.
Thanks,
Viji
Back to top
View user's profile Send private message
sreenigacc

New User


Joined: 16 Oct 2007
Posts: 15
Location: bangalore

PostPosted: Tue Apr 15, 2008 8:19 pm
Reply with quote

hi vijikesavan,

yes, if we declare that for a same column what does it mean?

thanks
sreeni
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Apr 15, 2008 8:26 pm
Reply with quote

You can define it either way but NOT both!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts String has hex character need to conv... COBOL Programming 3
No new posts How to display the leading zeros of a... DB2 7
Search our Forums:

Back to Top