|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Error in ESQL Code in Compute Node |
« View previous topic :: View next topic » |
Author |
Message
|
ARAMARK |
Posted: Fri Sep 07, 2007 9:30 am Post subject: Error in ESQL Code in Compute Node |
|
|
Novice
Joined: 07 Sep 2007 Posts: 14
|
Hi,
I have developed a message flow which will connect to a database and retrieve data from a table and put it as xml message in the output queue.I have configured the DSN through ODBC and had also given the DataSourceName in Compute Node Properties.But,I am not able to retrieve data from the table.My ESQL code is as below:
CREATE COMPUTE MODULE msg_flowSep05_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
DELETE FIELD OutputRoot.*[<];
SET OutputRoot.XML.Test.Result[] =
(SELECT T.Column1, T.Column2 FROM Database.DataSourceName.USERTABLE AS T);
END;
END MODULE;
But,I am getting the exception as Unable to resolve identifiers as T.Column1 and unable to resolve identifiers as Database.DataSourceName.USERTABLE AS T etc etc.
When I am replacing the database name as SAMPLE .i.e.(SELECT T.Column1, T.Column2 FROM SAMPLE.Test.USERTABLE AS T), where SAMPLE is the database alias name and Test is the DSN,then also it is throwing error
Please advice if anything is wrong in the above code or have I missed something to configure WBIMB in order to connect to remote database. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 07, 2007 9:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please do not use the XML domain.
Please do not put your own code into CopyEntireMessage or CopyMessageHeaders. This will only confused every single person who ever has to maintain this code.
Please don't copy the entire message, and then delete everything except the headers.
Please confirm that you have used the actual word "Database". So that, for example, if your ODBC DataSourceName is "MYDSN", and your Table is called SampleTable, then your statement reads "SELECT T.Column1, T.Column2 from Database.MYDSN.SampleTable AS T"
Please confirm that you are seeing ERRORS, and not WARNINGS that only appear in the Toolkit. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ARAMARK |
Posted: Sat Sep 08, 2007 1:09 am Post subject: Error in ESQL Code in Compute Node |
|
|
Novice
Joined: 07 Sep 2007 Posts: 14
|
Hi,
Thanks for the suggestion.I am getting warnings on Toolkit.
And the name of my database alias is SAMPLE ,Please suggest whether I need to replace "Database" by "SAMPLE" in the statement "SELECT T.Column1, T.Column2 from Database.MYDSN.SampleTable AS T".
And also,Please suggest whether I need to give the DtaSourceName or the schema name in the above statement.
And You have said not use the xml domain,Does it mean not to select xml in Domain field while setting the properties of Input Node?
Please suggest asap...
Thanks in advance |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Sep 08, 2007 4:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can either ignore the warnings or create a database definition in your project.
Yes, it means "do not select XML in domain field in input node".
It also means "Do not code anything that looks like OutputRoot.XML or InputRoot.XML"...  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ARAMARK |
Posted: Sat Sep 08, 2007 4:38 am Post subject: Error in SQL Code in Compute Node |
|
|
Novice
Joined: 07 Sep 2007 Posts: 14
|
Thanks once again....
I have one more doubt....
How does the toolkit connect to database and retrieve data from a table?Is it done only by setting and defining the Data Source Node through ODBC and giving that DataSourceName while setting the properties of Compute Node?
OR
We need to do some additional configuration in the toolkit?Do we need to define meessage sets for it ?And,how will toolkit deploy the messageflow when a table is updated in roder to retrieve and process the updated information?
Please suggest
Thanks in advance |
|
Back to top |
|
 |
Vitor |
Posted: Sat Sep 08, 2007 5:02 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
The toolkit doesn't do any of these things. The flow does when it's deployed. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|