ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » insert values into table

Post new topic  Reply to topic
 insert values into table « View previous topic :: View next topic » 
Author Message
Piker
PostPosted: Fri May 17, 2002 8:39 am    Post subject: insert values into table Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Fri May 17, 2002 10:02 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Piker
PostPosted: Fri May 17, 2002 8:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Fri May 17, 2002 9:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Piker
PostPosted: Fri May 17, 2002 9:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Piker
PostPosted: Fri May 17, 2002 9:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » insert values into table
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.