Author |
Message
|
Harshalw |
Posted: Thu Jul 24, 2008 4:07 am Post subject: Selecting Columns from database in ESQL. |
|
|
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 |
|
 |
jeeth_m |
Posted: Thu Jul 24, 2008 4:35 am Post subject: |
|
|
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 |
|
 |
Harshalw |
Posted: Thu Jul 24, 2008 4:39 am Post subject: |
|
|
Voyager
Joined: 23 Jul 2008 Posts: 77
|
Yes it does return 1 row only |
|
Back to top |
|
 |
paintpot |
Posted: Thu Jul 24, 2008 4:43 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Thu Jul 24, 2008 11:21 am Post subject: |
|
|
 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 |
|
 |
sridhsri |
Posted: Thu Jul 24, 2008 11:47 am Post subject: |
|
|
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 |
|
 |
chrisc |
Posted: Thu Jul 24, 2008 7:33 pm Post subject: |
|
|
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 |
|
 |
|