View previous topic :: View next topic
|
Author |
Message |
chandramouliravi
New User
Joined: 27 Apr 2009 Posts: 26 Location: addison
|
|
|
|
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 |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
SMALLINT is a DB2 datatype ... what do you mean by converting 0 to smallint ? |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
This looks simialar to this post. You probably don't need the CASE command. |
|
Back to top |
|
|
chandramouliravi
New User
Joined: 27 Apr 2009 Posts: 26 Location: addison
|
|
|
|
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 |
|
|
|