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

Select value clause


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

New User


Joined: 07 Jul 2009
Posts: 2
Location: Chennai

PostPosted: Mon Oct 04, 2010 8:41 pm
Reply with quote

I came across a query like this :

SELECT VALUE(SUM(COL1),0)
INTO :WS-VAR1
.........................

Can anyone let me know what the VALUE(SUM(COL1),0) clause does actually.

Thanks
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Oct 04, 2010 8:45 pm
Reply with quote

Hello,

Suggest you try the query in spufi (without the host variable). . .
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Oct 04, 2010 9:20 pm
Reply with quote

or look up value() in the manual.
It does the same as coalesce()

One thing to keep in mind is that "select sum() from tab where ..." returns null when no rows qualify the where clause
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 Dynamically pass table name to a sele... DB2 2
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top