Author |
Message
|
ragi_kmm |
Posted: Wed Feb 06, 2013 4:39 am Post subject: Usage of SELECT statement in ESQL |
|
|
Novice
Joined: 19 Sep 2006 Posts: 13
|
Hi MQSeries.net users
I am calling a DB stored proc to get the results in to Environment variable.
Later I am using SELECT statement to assign the result set (from Env variable) to the Output Root.
For suppose, there are 50 fields in the result set.
my requirement is:
If "A" then Populate all 50 fields
ELSE
Populate only 40 fields.
I m trying to understand if there is a way to include this logic while retriving the records from Env variable using SELECT function?
Thank you for your replies |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 06, 2013 4:40 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you assign the result set to the output root, how will it possibly create more fields than exist in the result set? |
|
Back to top |
|
 |
ragi_kmm |
Posted: Wed Feb 06, 2013 4:43 am Post subject: |
|
|
Novice
Joined: 19 Sep 2006 Posts: 13
|
Sorry, I believe, my post is not clear
Yes, Result set has all the 50 fields (SP returns 50 fields)
Btw, I m using WMB 8 _________________ Best Regards,
Giri |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 06, 2013 4:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Either you are still being very unclear, or you are missing something basic.
ESQL is a programming language.
You can write any kind of programming logic you want in it.
You can choose to write individual SET statements to set fields individually or you can use certain kinds of constructs to assign many fields at once.
You can choose to set fields in four entirely separate places within a compute node - in the OutputRoot, in the OutputLocalEnvironment, in the OutputEnvironment, or in any variables you have declared yourself. |
|
Back to top |
|
 |
McueMart |
Posted: Wed Feb 06, 2013 4:58 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
I believe the OP is looking for a similar capability to the LIMIT function of normal SQL. I don't believe this can be used when selecting out of a message tree. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 06, 2013 5:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
McueMart wrote: |
I believe the OP is looking for a similar capability to the LIMIT function of normal SQL. I don't believe this can be used when selecting out of a message tree. |
Ok. OP is also mentioning an SP - presumably a 'stored procedure'. In theory this should be able to implement the necessary LIMIT.
Otherwise, there are clearly plenty of ways to do conditional mapping in ESQL. |
|
Back to top |
|
 |
ragi_kmm |
Posted: Wed Feb 06, 2013 6:42 am Post subject: |
|
|
Novice
Joined: 19 Sep 2006 Posts: 13
|
thanks for the replies.
Yes, we have used normal mapping earlier, which works very well.
we had performance issues, so we have opted to use SELECT statement. |
|
Back to top |
|
 |
|