|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SELECT function |
« View previous topic :: View next topic » |
Author |
Message
|
visasimbu |
Posted: Mon Aug 12, 2013 1:14 pm Post subject: SELECT function |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Hi
Input msg :
Code: |
<Purchases>
<Item>
<ID>111AAA</ID>
<Author>David</Author>
<Quantity>2</Quantity>
</Item>
<Item>
<ID>222BBB</ID>
<Author>Andrew</Author>
<Quantity>2</Quantity>
</Item>
<Item>
<ID>333CCC</ID>
<Author>Neil</Author>
<Quantity>2</Quantity>
</Item>
</Purchases>
|
Quote: |
Expected output : 111AAA,222BBB,333CCC in the variable. |
Used the below list of esql to obtain the expected result. But it is not working. I am not sure whether this can be achieved it throw select statement.
Code: |
SET Environment.Variables.outputString[] = SELECT (CAST (RS.ID AS CHARACTER)) || ',' || TEMP AS TEMP
FROM Purchases.Item[] AS RS ; |
Is it possible to achieve string concatenation using Select statement ?
I got chance to view the below links.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak05750_.htm |
|
Back to top |
|
 |
kimbert |
Posted: Mon Aug 12, 2013 2:04 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Is it possible to achieve string concatenation using Select statement ? |
No - at least, the info center does not say that it can, and I cannot think of a way to do it.
It would probably be simpler to write a FOR loop to produce your string. If you are doing a lot of string concatenation like this, then you should ask yourself whether the DFDL parser ( only available in v8 ) would do the job more easily. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
visasimbu |
Posted: Mon Aug 12, 2013 2:09 pm Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
kimbert wrote: |
Quote: |
Is it possible to achieve string concatenation using Select statement ? |
No - at least, the info center does not say that it can, and I cannot think of a way to do it.
It would probably be simpler to write a FOR loop to produce your string. If you are doing a lot of string concatenation like this, then you should ask yourself whether the DFDL parser ( only available in v8 ) would do the job more easily. |
We are using WMB 7.0.0.4 Version.
Yes I know that we can achieve it throw FOR loop. But Just curiosity to know, whether it can be done through select query ?
Since I have done the SUM of Quantity using select statement. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Aug 12, 2013 3:25 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I still think that the required output looked like a delimited record. That kind of message-tree-to-data-format conversion is usually best done by a parser like DFDL ( in v8 ) or MRM TDS ( in v6/7 ). _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|