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

Adding SMALLINT 0 to select query


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

New User


Joined: 27 Apr 2009
Posts: 26
Location: addison

PostPosted: Tue Aug 04, 2009 6:51 pm
Reply with quote

Hi,

I have a selet query like this.

SELECT FIELD1, FIELD2, FIELD3
from EMPLOYEE

I have to append 3 smallint fields to the select query with 0's like this.

SELECT FIELD1, FIELD2, FIELD3,
SMALLINT(0),
SMALLINT(0),
SMALLINT(0)
from EMPLOYEE

I know that SMALLINT(0) will not work.
Could you please suggest right syntax.
I do not like to use 2 steps here. So i am trying to do in SELECT itself.
Each ZERO added at the end should be of size SMALLINT.
Thats why i am trying to conert 0 to SMALLINT by using SMALLINT(0).

Thanks,
Chandramouli
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Aug 04, 2009 8:14 pm
Reply with quote

SMALLINT is a DB2 datatype ... what do you mean by converting 0 to smallint ?
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Aug 05, 2009 10:15 am
Reply with quote

This looks simialar to this post. You probably don't need the CASE command.
Back to top
View user's profile Send private message
chandramouliravi

New User


Joined: 27 Apr 2009
Posts: 26
Location: addison

PostPosted: Wed Aug 05, 2009 10:27 am
Reply with quote

Hi all,

Thanks foryour reply.
When i run in QMF, my command is running good.

Select fielda,SMALLINT(0),'0001-01-01' from employee

It is failing when i run this in a utility. the problem is with utility which i an using. I will get it fixed.
Thanks for your reply.

Thanks,
Chandramouli
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 Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts RC query -Time column CA Products 3
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Adding first / last acct numerber to ... DFSORT/ICETOOL 7
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top