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
 
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 How to force a select query to abend neo4u DB2 7 Mon Apr 23, 2018 1:36 pm
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts SELECT TO MULIPLE OUTFIL speermb DFSORT/ICETOOL 5 Fri Mar 23, 2018 10:44 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts How to replace the below query? pkmurali DB2 12 Tue Feb 27, 2018 9:51 pm

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