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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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