Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to retrieve DECIMAL value from a DB2 Table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Mar 23, 2010 8:21 pm    Post subject: How to retrieve DECIMAL value from a DB2 Table
Reply with quote

Dear Experts,

I have 2 Fields with datatype DECIMAL shown as below in my DB2 table.

COLNAME COLTYPE LENGTH SCALE
------- -------- ------ ------
QTY1 DECIMAL 15 3
QTY2 DECIMAL 15 2

Code:
Values in these columns looks like
------------------  ------------------
     -93058000.000        -99160692.50
       -100000.000          -106557.94
        -54000.000           -54183.33
      -4403000.000         -4691746.32
      -2489000.000         -2652227.25
        -50000.000           -54261.84


When I retrieve the columns as it as, they are displyed as NULL and junk values in my output report.

How to write a SELECT Query to retrieve the values as it is as shown above. i.e converting them into CHAR.

Please suggest ..
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 Mar 23, 2010 9:02 pm    Post subject:
Reply with quote

When I retrieve the columns as it as, they are displyed as NULL and junk values in my output report.

How to write a SELECT Query to retrieve the values as it is as shown above. i.e converting them into CHAR.


What are you using to select the data for the report?

Maybe that "JUNK VALUES" is packed decimal values?
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Mar 23, 2010 11:09 pm    Post subject:
Reply with quote

Hi Crag,

I used the function CHAR(QTY1) and CHAR(QTY2). and got the outputs as expected. bu leading Zeroes.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 23, 2010 11:14 pm    Post subject:
Reply with quote

Hello,

Does this mean that all is well or is there still something that needs help?

Quote:
bu leading Zeroes.

icon_confused.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us