Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Adding SMALLINT 0 to select query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Adding SMALLINT 0 to select query
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us