|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
BASIC ESQL for Database node using XMLNSC |
« View previous topic :: View next topic » |
Author |
Message
|
technok |
Posted: Mon May 26, 2008 3:16 am Post subject: BASIC ESQL for Database node using XMLNSC |
|
|
 Novice
Joined: 14 Oct 2001 Posts: 17 Location: Hong Kong
|
Hi, I am a ESQL new babe trying to create my first simple flow by creating a ESQL for SELECT database query from a simple XML message input.
MQInput (XMLNSC domain)-> Compute -> Database -> MQOutput
Input XML Message:
<ABC><transaction_log><MEM_NUMBER>1234</ABC></transaction_log></MEM_NUM>
Compute node:
a simple routing based on message
Database: (This is in trouble.)
My Oracle DB query is:
SELECT ABC.transaction_log.Number_of_Points
FROM ABC.transaction_log
WHERE ABC.transaction_log.MEM_NUMBER = '1234';
ORACLE SQL Result:
Number_of_Points
------------------------
10
-10
2 rows selected
What is my ESQL suppose to be to have an output message in XML like below:
<ABC><transaction_log><MEM_NUMBER>1234</MEM_NUMBER>
<Number_of_Points>10</Number_of_Points>
<Number_of_Points>-10</Number_of_Points>
</transaction_log></ABC>
Also, please introduce some online ESQL tutorial for me. Any response will be appreciated.  |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 26, 2008 7:59 pm Post subject: Re: BASIC ESQL for Database node using XMLNSC |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
technok wrote: |
Hi, I am a ESQL new babe trying to create my first simple flow by creating a ESQL for SELECT database query from a simple XML message input.
MQInput (XMLNSC domain)-> Compute -> Database -> MQOutput
Input XML Message:
<ABC><transaction_log><MEM_NUMBER>1234</ABC></transaction_log></MEM_NUM> |
Your input message is all wrong.
It should be
<ABC><transaction_log><MEM_NUMBER>1234</MEM_NUMBER></transaction_log></ABC>
technok wrote: |
Compute node:
a simple routing based on message
Database: (This is in trouble.)
My Oracle DB query is:
SELECT ABC.transaction_log.Number_of_Points
FROM ABC.transaction_log
WHERE ABC.transaction_log.MEM_NUMBER = '1234';
ORACLE SQL Result:
Number_of_Points
------------------------
10
-10
2 rows selected
What is my ESQL suppose to be to have an output message in XML like below:
<ABC><transaction_log><MEM_NUMBER>1234</MEM_NUMBER>
<Number_of_Points>10</Number_of_Points>
<Number_of_Points>-10</Number_of_Points>
</transaction_log></ABC>
Also, please introduce some online ESQL tutorial for me. Any response will be appreciated.  |
The query is missing keyword DATABASE
Read the manuals and check out the links peppered all over the forum... _________________ MQ & Broker admin |
|
Back to top |
|
 |
technok |
Posted: Mon May 26, 2008 10:29 pm Post subject: |
|
|
 Novice
Joined: 14 Oct 2001 Posts: 17 Location: Hong Kong
|
Thank you for your help. I read the manual and there is no fully understandable sample inside (fragment examples only), it may be good for experts as reference but for sure not for a new babe like me, that's why I am looking for some basic tutorial online. I was confused and was too sleepy, my fault on XML input.
Anyway, that's ORACLE SQL, not ESQL. I have done the following ESQL:
CREATE COMPUTE MODULE ABC_ABC
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot = InputRoot;
call GetDataFromDB();
RETURN TRUE;
END;
END MODULE;
CREATE PROCEDURE GetDataFromDB()
BEGIN
SET OutputRoot.XMLNSC.transaction_log.Number_of_Points[] = SELECT A.Number_of_Points
FROM Database.ABC.XYZ.Reward_transaction_log AS A
WHERE (A.MEM_NUMBER = InputRoot.XMLNSC.ABC.Reward_transaction_log.MEM_NUMBER);
END;
However, Toolkit warns me on "Unresolvable table reference...
Also, "Identifier 'OutputRoot' cannot be resolved. |
|
Back to top |
|
 |
Gaya3 |
Posted: Mon May 26, 2008 10:43 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
1. pass OutputRoot as a Reference to the Procedure, it will work
2. you can remove the warnings by Pulling out the DATA Perpective from the Window menu and resolve the database connection.
Regards
gayathri _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
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
|
|
|
|