Author |
Message
|
asajnani |
Posted: Tue Oct 01, 2002 2:50 am Post subject: Emergency ESQL Problem Compute Node |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Solved the issue. My bad. I have this issue now if you can help me out
I just want to put my recordset into a string and assign it to the output root but I do not know how to change a list to a string to be assigned to a scalar value. Is there a function of recordset to assign it's data in string like visualbasic? So ,I want to return a field name to the output root and when i do this it does not work. I am using a compute node.
input-->Compute-->output
SET Environment.Variables.ResultSet.data[] =PASSTHRU('SELECT * FROM stacey.project');SET OutputRoot=Environment.Variables.ResultSet.Record[1]."projno" ;
There is a failure doing and using the debugger all error messages i get is in the output node that no message data. I have tried hardcoding outputroot='test' and same error message. THis is strange when i assign outpoot root to the input root it works fine Can anyone advise me?
I know that that the select statement is being executed correctly. I assigned a output root xml to it and saw it using the debugger.
Thanks Anant |
|
Back to top |
|
 |
lbrett |
Posted: Tue Oct 01, 2002 3:29 am Post subject: |
|
|
Novice
Joined: 24 Jan 2002 Posts: 20
|
Try SET OutputRoot.XML.Result=Environment.Variables.ResultSet.Record[1]."projno" ;
You need to have a parser associated with every output message in a compute node. |
|
Back to top |
|
 |
asajnani |
Posted: Tue Oct 01, 2002 12:24 pm Post subject: It didn't work |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Hey
SET Environment.ResultSet.Data[]=Passthru('select * from stacey.project');
SET OutputRoot.XML.Result= Environment.ResultSet.Record[1]."projno" ;
The output root trew an error xml parser which reflected the error not valid document.
I just want to return the result in the outputroot result field. Nothing more. Do i need to deal with XML here?
If you can do Set OutputRoot=InputRoot it should makes sense to assign it to a variable?
Thanks Anant |
|
Back to top |
|
 |
kirani |
Posted: Tue Oct 01, 2002 1:09 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
First, try printing your Environment tree and find out exact field reference to Record[1]."projno".
In a compute node, select "Copy message headers only" and then use following code.
Code: |
SET Environment.ResultSet.Data[]=Passthru('select * from stacey.project');
SET OutputRoot.XML.Result = Environment.ResultSet.Data[1].<correct_field_reference> ;
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
asajnani |
Posted: Tue Oct 01, 2002 1:51 pm Post subject: How do i print the environment tree? |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Sorry dude once again how do i print this environment tree? Tried the integrator manulas Thanks Once Again |
|
Back to top |
|
 |
asajnani |
Posted: Tue Oct 01, 2002 1:59 pm Post subject: Kirani still didn't work |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Kirani
Still having the issue wit the output node. XML Writing errors occured. No valid body error number 5005. I just want to put one field on the output root.
Thanks Anant[/img] |
|
Back to top |
|
 |
asajnani |
Posted: Tue Oct 01, 2002 2:01 pm Post subject: Kiran question for you |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Is there a way i could put the resultset onto te output root directly using some conversion funtion? |
|
Back to top |
|
 |
kirani |
Posted: Tue Oct 01, 2002 3:08 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Comment out second line in your compute node and attach a Trace node to the out terminal of Compute node. Write Trace output to some file and print ${Environment} in it. Send out some message on input queue, your trace file will have retrieved data from database. Look at the proper level for the element you are trying to refer to in your compute node.
Use the same level/reference in second statement of your compute node. If you still have problems, post the contents of the trace file here and I will try to help you. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
asajnani |
Posted: Tue Oct 01, 2002 4:00 pm Post subject: Do you mean c:\trace.txt ${Environment} ? |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Do you mean c:\trace.txt ${Environment} in the trace file output of the compute node? |
|
Back to top |
|
 |
lbrett |
Posted: Wed Oct 02, 2002 4:36 am Post subject: |
|
|
Novice
Joined: 24 Jan 2002 Posts: 20
|
One of two things are happening.
1. The column projno does not exist in stacey.project table (and keep in mind that case matters).
2. There is no data being returned from your select (i.e. there is no data in the table). This will result in NULL being returned and the DATA tag in the Environment tree being deleted.
The easiest way to determine is if you use the following ESQL:
SET OutputRoot.XML.Result1.Result2= Passthru('select * from stacey.project');
If the problem is the result of #1 then you will not see the XML tag projno (and case matters) in the resulting XML string. If the the problem is the result of #2, then you will not see the Result2 tag anywhere in the resulting XML string. |
|
Back to top |
|
 |
asajnani |
Posted: Wed Oct 02, 2002 2:22 pm Post subject: Trace results |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Here it goes Kirani:
(0x1000000)ResultSet = (
(0x1000000)Data = (
(0x3000000)PROJNO = 'AD3100'
(0x3000000)PROJNAME = 'ADMIN SERVICES'
(0x3000000)DEPTNO = 'D01'
(0x3000000)RESPEMP = '000010'
(0x3000000)PRSTAFF = 6.50
(0x3000000)PRSTDATE = DATE '1982-01-01'
(0x3000000)PRENDATE = DATE '1983-02-01'
(0x3000000)MAJPROJ = ' '
Thanks Anant |
|
Back to top |
|
 |
kirani |
Posted: Wed Oct 02, 2002 3:00 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Anant,
As lbrett said in his post, case matters!! Earlier you were not referring to the element correctly.
Based on your Trace output your code should be:
Code: |
SET Environment.ResultSet.Data[]=Passthru('select * from stacey.project');
SET OutputRoot.XML.Result = Environment.ResultSet.Data[1].PROJNO ;
|
Select Copy message headers only in your compute node. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
asajnani |
Posted: Wed Oct 02, 2002 3:04 pm Post subject: Kirani thanks sorry one more question |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
Does this make sense?
SET Environment.ResultSet.Data[]=Passthru(InputRoot);
SET OutputRoot.XML.Result = Environment.ResultSet.Data[1].PROJNO ;
where I pass from the application as a put message 'select * from stace.project'
Thanks Anant |
|
Back to top |
|
 |
kirani |
Posted: Wed Oct 02, 2002 3:36 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
This code will not work.
You will have to first create "string" from input message using CAST function and then you can pass that string/text to PASSTHRU function.
http://www.mqseries.net/phpBB2/viewtopic.php?p=20537&highlight=#20537 _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
asajnani |
Posted: Wed Oct 02, 2002 3:45 pm Post subject: Message contains no data at output node |
|
|
Novice
Joined: 04 Mar 2002 Posts: 21
|
I see the XML results being populated but still at the output node i get message contains no data. I only chose copy message headers. |
|
Back to top |
|
 |
|