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
 

 

Override a value through sql

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Mahua Mitra

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu Dec 06, 2007 1:02 pm    Post subject: Override a value through sql
Reply with quote

Hi
Say I have a query:
Selet A, B, C
from tableA

My req is whatever be the value of A, B and C, the value of must display as 1.

Say in tableA the values are;
A B C
2 d e
3 f g

Once we run the above query, the result set must be:
A B C
1 d e
1 f g

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

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Dec 06, 2007 1:07 pm    Post subject:
Reply with quote

Mahua,

Quote:
My req is whatever be the value of A, B and C, the value of must display as 1.

What is the reason behind this? I believe IBM has not thought of such kind of 'business requirements'.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 06, 2007 1:18 pm    Post subject:
Reply with quote

Murali,
There will be some instances in which you need to hardcode the values in the query. I have some queries like that in my applications.
Mahua, you can use the following query.
Select '1', B, C
from tableA
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Dec 06, 2007 1:21 pm    Post subject:
Reply with quote

Hari,

Quote:
There will be some instances in which you need to hardcode the values in the query.

I agree with you. But TS wanted col A value to be displayed as '1' irrespective of actual value. I belive this is not HARDCODING the value.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 06, 2007 1:24 pm    Post subject:
Reply with quote

Ok Murali. In that case, Probably Mahua can use this,
Select '1' AS A, B, C
from tableA;

I am expecting Mahua's response to see what exactly he needs.
Back to top
View user's profile Send private message
Mahua Mitra

New User


Joined: 26 Apr 2007
Posts: 49
Location: Delhi

PostPosted: Thu Dec 06, 2007 3:08 pm    Post subject:
Reply with quote

Thanks a lot Srihari,
That was o great help.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 06, 2007 3:17 pm    Post subject:
Reply with quote

You are welcome. icon_smile.gif
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 Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm
No new posts Symbolic OverRide within a 'Include' ... Sysaron JCL & VSAM 7 Thu Aug 27, 2015 10:51 pm
No new posts Help in File Tailoring services ( Ove... thesumitk TSO/ISPF 8 Wed Jun 17, 2015 12:04 pm
No new posts Override Condition code richards12388 JCL & VSAM 3 Sat May 16, 2015 9:47 am
No new posts To Dummy out a PDs through Override Sikkandhar JCL & VSAM 8 Tue Nov 26, 2013 11:18 pm


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