Author |
Message
|
Piker |
Posted: Fri May 17, 2002 8:39 am Post subject: insert values into table |
|
|
Novice
Joined: 17 May 2002 Posts: 10
|
Hi
I'm new in WMQI and got a problem.
First of all, in compute node I made
create field OutputRoot.XML.Result;
set OutputRoot.XML.Result[] = (select * from Database.Testbase.tablein);
Now I got xml message;
And I tried to insert the results into output table by Database node
declare i integer;
set i = 1;
while i <= cardinality(Body.Result[]) do
insert into Database.Testbase.tableout
(el1, el2)
value
(Body.Result[i].el1,
Body.Result[i].el2);
set i = i +1;
end while;
But unfortunately all records inserted into table were empty.
What should I do to correct this propblem?;
 |
|
Back to top |
|
 |
kirani |
Posted: Fri May 17, 2002 10:02 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Looks like either your XML tree is not populated or you are not referring to correct XML fields in your Database node.
Try using following ESQL in your compute node,
set OutputRoot.XML.Result[] = (select T.* from Database.Testbase.tablein AS T);
Make sure Compute mode is set to 'Message' in Advanced Tab.
Try using a trace node in between your Compute node and Database node. Write the trace output to some file and check whether the XML tree is populated or not. _________________ 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 |
|
 |
Piker |
Posted: Fri May 17, 2002 8:47 pm Post subject: |
|
|
Novice
Joined: 17 May 2002 Posts: 10
|
(0x1000010)XML = (
(0x1000000)Result = (
(0x1000000)EL1 = (
(0x2000000) = 2
)
(0x1000000)EL2 = (
(0x2000000) = '1234f '
)
)
(0x1000000)Result = (
(0x1000000)EL1 = (
(0x2000000) = 2
)
(0x1000000)EL2 = (
(0x2000000) = 'ddd '
)
)
(0x1000000)Result = (
(0x1000000)EL1 = (
(0x2000000) = 2
)
(0x1000000)EL2 = (
(0x2000000) = 'ddd '
)
)
(0x1000000)Result = (
(0x1000000)EL1 = (
(0x2000000) = 3
)
(0x1000000)EL2 = (
(0x2000000) = 'ffff '
)
)
)
I've got this record in trace file. it seems to be ok but maybe should I make the whole XML whis the header etc? |
|
Back to top |
|
 |
kirani |
Posted: Fri May 17, 2002 9:09 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
You have mistyped the element names (EL1 and EL2) in the your ESQL.
So your insert statement would be,
insert into Database.Testbase.tableout (el1, el2)
value
(Body.Result[i].EL1, Body.Result[i].EL2);
Have a great weekend! _________________ 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 |
|
 |
Piker |
Posted: Fri May 17, 2002 9:25 pm Post subject: |
|
|
Novice
Joined: 17 May 2002 Posts: 10
|
Nope. There is no mistake. I have two tables
testin (el1 number, el2 character)
tableout (el1 character, el2 number, el3 double)
Each element in these tables may be null.
Thanks :)
The same to you :) |
|
Back to top |
|
 |
Piker |
Posted: Fri May 17, 2002 9:50 pm Post subject: |
|
|
Novice
Joined: 17 May 2002 Posts: 10
|
Thank you for your help.
I've found the solution.
I should use
insert into <table>
(el1, el2)
values
(Body.Result[i].(XML.Element)EL2,
Body.Result[i].(XML.Element)EL1)
Thank you again :)) |
|
Back to top |
|
 |
|