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 » SELECT statement correlation name not valid

Post new topic  Reply to topic
 SELECT statement correlation name not valid « View previous topic :: View next topic » 
Author Message
lancelotlinc
PostPosted: Wed Jan 25, 2012 1:10 pm    Post subject: SELECT statement correlation name not valid Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Hi -

SOAPInput -> Compute -> SOAPReply

WMB 7.0.0.2 Ifix 2

Code:

    SET OutputLocalEnvironment.XMLNSC.Data.SelectResult.Row[] =
      PASSTHRU ('SELECT indtable.USER FROM IND.TXN
                 AS indtable WHERE indtable.TXN_ID = ?'
      VALUES ( CAST( InputRoot.SOAP.Body.TransactionId AS DECIMAL )));
       
    SET user = OutputLocalEnvironment.XMLNSC.Data.SelectResult.Row[1];



When deploying successfully compiled flow to EG:
Quote:
Correlation name 'TXN_ID' not valid.


How to escape the TXN_ID so that it passes through?

Control-space on 'indtable.' shows a list with TXN_ID in it.


Alternately, also tried the direct SELECT statement with same result (ie. not passthru).

Can someone please suggest to me things to try so that the Bar will deploy to the EG without the error ?


Quote:

Event Type: Error
Event Source: WebSphere Broker v7002
Event Category: None
Event ID: 2432
Date: 1/25/2012
Time: 2:06:29 PM
User: N/A
Computer: <systemname>
Description:
( MB7_xxx.xx_EG06 ) ('com.company.middleware.flows.<project>.xxx_subflow_Compute1.Main', '110.11') : The correlation name ''TXN_ID'' is not valid. Those in scope are: 'xxx, yyyy, etc etc etc ... Environment, InputLocalEnvironment, OutputLocalEnvironment, InputRoot, InputBody, InputProperties, OutputRoot, InputExceptionList, OutputExceptionList, InputDestinationList, OutputDestinationList, zyx'.

The first element of a field reference must be a valid correlation name, from those in scope. This message may sometimes be due to an incorrectly formed or spelled expression which is not intended to be a field reference being parsed as if it were a field reference because the parser does not recognize it.

Correct the syntax of your ESQL expression in node ''com.<company>.middleware.flows.project.xxx_subflow_Compute1.Main'', around line and column ''110.11'', then redeploy the message flow.
Data:
0000: 31 00 32 00 30 00 30 00 1.2.0.0.

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jan 25, 2012 1:15 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So you're using a PASSTHRU, which means you need to use a valid SQL select statement, rather than a valid ESQL select statement.

So try
Code:
  SET OutputLocalEnvironment.XMLNSC.Data.SelectResult.Row[] =
      PASSTHRU ('SELECT USER FROM IND.TXN
                 WHERE TXN_ID = ?'
      VALUES ( CAST( InputRoot.SOAP.Body.TransactionId AS DECIMAL )));
Back to top
View user's profile Send private message
adubya
PostPosted: Wed Jan 25, 2012 1:20 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

The OP's SQL looked valid to me.
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jan 25, 2012 1:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Cut & pasted your code verbatim and still same error. I need to be able to escape TXN_ID. For some reason, the runtime is not liking that database column name.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jan 25, 2012 1:35 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
Cut & pasted your code verbatim and still same error. I need to be able to escape TXN_ID. For some reason, the runtime is not liking that database column name.


ESQL will accept double-quotes inside of single quotes as quotable text.

So
Code:
SET OutputLocalEnvironment.XMLNSC.Data.SelectResult.Row[] =
      PASSTHRU ('SELECT USER FROM IND.TXN
                 WHERE "TXN_ID" = ?'
      VALUES ( CAST( InputRoot.SOAP.Body.TransactionId AS DECIMAL )));
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jan 25, 2012 1:44 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Double-quotes not work either. Same error. BIP2087E
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
adubya
PostPosted: Wed Jan 25, 2012 1:49 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

As a test, if you change the SQL to use a different column than TXN_ID in the WHERE clause (and a compatible VALUE entry) then does it work ?

Trying to confirm if it's definitely the "TXN_ID" bit.
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Jan 25, 2012 1:55 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi.

Look at the syntax diagram for PASSTHRU again in the info center. You have mixed up two different "styles" of PASSTHRU

The two key valid types for this case are:

PASSTHRU 'expression' VALUES ( 'xxx' );

and

PASSTHRU ( 'expression' , 'xxx' );

The first type is a "newer" form which allows the DSN to be speficied as well (with a TO clause), and the second is an "older" type which does not and is more like a function than a statement.

However, you have a mix of these styles which is invalid.


Kind Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
adubya
PostPosted: Wed Jan 25, 2012 1:59 pm    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

He seems to be meeting the syntax of the PASSTHRU function as per infocentre

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fak05890_.htm&resultof=%22passthru%22%20

No ?
Back to top
View user's profile Send private message Send e-mail
lancelotlinc
PostPosted: Wed Jan 25, 2012 3:04 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Thanks for the expert help quick !

The BIP2087E was caused by a different (E)SQL statement elsewhere in the file which, when fixed, the error went away. I had touched that previous statement yesterday and moved on to this piece of code and spent alot of today on the code I posted. Both statements use the TXN_ID, and when adubya asked to change it, the TXN_ID error still occured, which led me to the earlier statement.

Silly rabbit, Trix are for Kids.


Thanks again !!
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SELECT statement correlation name not valid
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.