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 » Selecting Columns from database in ESQL.

Post new topic  Reply to topic
 Selecting Columns from database in ESQL. « View previous topic :: View next topic » 
Author Message
Harshalw
PostPosted: Thu Jul 24, 2008 4:07 am    Post subject: Selecting Columns from database in ESQL. Reply with quote

Voyager

Joined: 23 Jul 2008
Posts: 77

I wanted to select a column value into a varibale and use that variable for further processing.

Here is the code
DECLARE CAGWX CHARACTER;

Set CAGWX = THE (Select CTR.PRICECODE from Database.SAPR3.TYPE_CTR AS CTR
WHERE CTR.PRICETYPE = InputRoot.XML.wwprttxn.price.pricetype
AND CTR.COUNTRY = InputRoot.XML.wwprttxn.price.country);

Here it is giving me exception . Please let me know the problem here. Do i need to use list here?
Back to top
View user's profile Send private message
jeeth_m
PostPosted: Thu Jul 24, 2008 4:35 am    Post subject: Reply with quote

Voyager

Joined: 21 Jan 2002
Posts: 93

what exception you are getting? Are you sure it returns only one value in the response?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Harshalw
PostPosted: Thu Jul 24, 2008 4:39 am    Post subject: Reply with quote

Voyager

Joined: 23 Jul 2008
Posts: 77

Yes it does return 1 row only
Back to top
View user's profile Send private message
paintpot
PostPosted: Thu Jul 24, 2008 4:43 am    Post subject: Reply with quote

Centurion

Joined: 19 Sep 2005
Posts: 112
Location: UK

'THE' will give one row anyway.

Is the returned data of character format?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jul 24, 2008 11:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
it is giving me exception

I cannot answer your question, but I can give you some advice. Always, always quote the error. Without that information, how can anybody help you?
Back to top
View user's profile Send private message
sridhsri
PostPosted: Thu Jul 24, 2008 11:47 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

I see that you are using XML parser which is deprecated and I think was only for WMQI 2.1. You are advised to change to XMLNSC parser (v6 onwards) or at least to the XMLNS parser (v5 onwards).
Back to top
View user's profile Send private message
chrisc
PostPosted: Thu Jul 24, 2008 7:33 pm    Post subject: Reply with quote

Voyager

Joined: 19 Mar 2006
Posts: 77

Try something like:
Code:
DECLARE CAGWX CHARACTER;

Set CAGWX = THE (Select ITEM CTR.PRICECODE from Database.SAPR3.TYPE_CTR AS CTR
WHERE CTR.PRICETYPE = InputRoot.XML.wwprttxn.price.pricetype
AND CTR.COUNTRY = InputRoot.XML.wwprttxn.price.country);

i.e. put "ITEM" between Select and CTR.PRICECODE.

If you don't put ITEM in, it is probably trying to put your PRICECODE as a child element of CAGWX, which isn't allowed since it isn't a tree element.

(Disclaimer: I haven't tried this, mind you, but that's what jumped out at me when I saw your code.)
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 » Selecting Columns from database in ESQL.
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.