|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to handle inner Query's in select statement in ESQL |
« View previous topic :: View next topic » |
Author |
Message
|
prabhakarp |
Posted: Thu Jul 31, 2003 7:33 am Post subject: How to handle inner Query's in select statement in ESQL |
|
|
Newbie
Joined: 30 Jul 2003 Posts: 7
|
SET CEUREFITEM=
THE(select ITEM sp.sellerid from Database.SPREFCOUNT_VIEW as sp where sp.buyerid=UREFITEM and sp.buyerpartnum = BUYERPARTNUM and sp.userid in
(select AM.ARIBA_ID FROM Database.um.ARIBAMAP as AM where AM.UM_ID in
(select AN.erpowner_id from um.erpmap AN where AN.buyer_id = UM_UCOMPANYREF and AN.erpnum=ACCOUNTNUMBER) and AM.TYPE = 'USER'));
I am new to MQ. when i try to execute this query i am getting the following exception.
i also PASSTHRU, getting same exception.
BIP2401E: Syntax error : expected ')' but found 'integer AM'.
The expected token was not found.
Correct the syntax of your expression and redeploy the message flow.
but i took that piece of code and execute on oracle it is file.
Can anybody help me what's the wrong in that. |
|
Back to top |
|
 |
Empeterson |
Posted: Thu Jul 31, 2003 7:42 am Post subject: |
|
|
Centurion
Joined: 14 Apr 2003 Posts: 125 Location: Foxboro, MA
|
Part of the problem is that you cannot query multiple database's in the same node. You will need to do you inner selects in a previous node and pass those results in the Environment tree. _________________ IBM Certified Specialist: MQSeries
IBM Certified Specalist: Websphere MQ Integrator |
|
Back to top |
|
 |
prabhakarp |
Posted: Thu Jul 31, 2003 7:54 am Post subject: |
|
|
Newbie
Joined: 30 Jul 2003 Posts: 7
|
Empeterson,
Thanks for your help. I used Environment tree, i am able to deploy but i am getting the some problem with the in Clause.
DECLARE ARIBASUPP CHAR;
SET Environment.Variables.SUPPLIST[] = (select AN.erpowner_id from Database.um.erpmap as AN where AN.buyer_id = 10002 and AN.erpnum ='TEST' and AN.address_id IS NULL);
SET SUPPSIZE= CARDINALITY(Environment.Variables.SUPPLIST[]);
i got SUPPSIZE is 2
IF SUPPSIZE > 1 THEN
DECLARE I INTEGER;
SET I = 1;
SET ARIBASUPP='';
WHILE I <= SUPPSIZE DO
SET UM_CEUREFITEM=CAST (Environment.Variables.SUPPLIST[I].erpowner_id AS INTEGER);
SET TEMPHOLD= THE(select ITEM AM.ARIBA_ID FROM Database.um.ARIBAMAP as AM where AM.UM_ID = UM_CEUREFITEM and AM.TYPE = 'USER');
SET ARIBASUPP=ARIBASUPP||','||TEMPHOLD;
SET I = I+1;
END WHILE;
SET ARIBASUPP=Substring(ARIBASUPP FROM 2 FOR LENGTH(ARIBASUPP));
END IF;
I got AribaSUPP = '5266,5267'
IF SUPPSIZE > 1 THEN
SET CEUREFITEM= THE(select ITEM sp.sellerid from Database.SPREFCOUNT_VIEW as sp where sp.buyerid=UREFITEM and sp.buyercompanyref=UCOMPANYREF
and sp.buyerpartnum = BUYERPARTNUM and sp.countryref =COUNTRY and sp.sellerid in(ARIBASUPP));
SET Environment.Variables.FINALARIBASUP1=CEUREFITEM;
END IF;
CEUREFITEM should retuen one value(5267), but it is allways return null; |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|