IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2, write report based on query output value


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subhadrasn

New User


Joined: 01 Mar 2022
Posts: 6
Location: India

PostPosted: Thu May 19, 2022 6:40 pm
Reply with quote

I have to create a report by combining multiple tables, matching my condition.

Now my problem is, I have to write down the mail id in the report. For a particular customer, we can have multiple mail IDs, say personal mail id, secondary mail id, Customer mail id and few more options.
When 2 or more mail ids are there, i have to chose Primary mail first and if primary is not available, then say secondary and if that is also not available, then Customer mail id.
Mail IDs are in a single column, Mail id code to define primary or sec is another column.
Basically i need to check the Mail_id_code value and based on that write the mail id from other column into report.

How should i query this now please.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Thu May 19, 2022 7:14 pm
Reply with quote

subhadrasn wrote:
I have to create a report by combining multiple tables, matching my condition.

Now my problem is, I have to write down the mail id in the report. For a particular customer, we can have multiple mail IDs, say personal mail id, secondary mail id, Customer mail id and few more options.
When 2 or more mail ids are there, i have to chose Primary mail first and if primary is not available, then say secondary and if that is also not available, then Customer mail id.
Mail IDs are in a single column, Mail id code to define primary or sec is another column.
Basically i need to check the Mail_id_code value and based on that write the mail id from other column into report.

How should i query this now please.

I personally did not understand: who is who, and what is what?

1. Please, try to explain your problem more clearly.

2. Besides of this, please demonstrate what did you try so far by yourself?

3. Do not forget to emphasize all your samples of data, and of code. You have to use the Code button to do this.

Without presenting all 1-2-3 to the forum, there is a very little chance to get any answer.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts RC query -Time column CA Products 3
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top