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 » ESQL SELECT with ITEM doesnt work

Post new topic  Reply to topic
 ESQL SELECT with ITEM doesnt work « View previous topic :: View next topic » 
Author Message
omerakhter
PostPosted: Tue May 19, 2009 4:43 am    Post subject: ESQL SELECT with ITEM doesnt work Reply with quote

Novice

Joined: 19 May 2009
Posts: 22

Hello

I have trying to SELECT from a database view which has single column of type varchar2 using the following statement but it doesn't work:

DECLARE TEMP ROW;

SET TEMP[] = SELECT ITEM T.TID FROM Database.ORCL.UPDATE_VIEW AS T;

Can anyone please tell me whats wrong here?

I am using Message Broker 6.1
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue May 19, 2009 4:57 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

How do you mean doesnt work? doesnt return anything or throws an error?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 19, 2009 5:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

See, when I try and run that exact piece of ESQL, it complains that it can't find a database table of that name.

So it doesn't work for me either.
Back to top
View user's profile Send private message
omerakhter
PostPosted: Tue May 19, 2009 5:18 am    Post subject: Reply with quote

Novice

Joined: 19 May 2009
Posts: 22

Well when I use the above syntax, it marks the error in editor with a RED X sign and says

"Syntax error. Valid options include: identifier ) } ] , || / = >= > <= < - <> ( . + ; *
AND AS BEGIN CALL CASE CATALOG CREATE DAY DECLARE DEFAULT
DELETE DO DOMAIN ELSE ELSEIF END ESCAPE EXCEPTION FOR FROM
HOUR IDENTIFIER IDENTITY IF IN INSERT INTO IS ITERATE LEAVE
LIKE LOOP MINUTE MODE MONTH NOT OR REPEAT RETURN SECOND
THEN TO UNTIL VALUES WHEN WHERE WHILE YEAR"

And when I modify this to be

DECLARE TEMP ROW;
SET TEMP = SELECT ITEM T.TID FROM Database.ORCL.UPDATE_VIEW AS T;

The broker doesnt allow me to deploy and logs an erroe in Error Log which says:

"BIP2497E: (.TESTFLOW_Compute.Main, 30.7) : Illegal data type for target. A list field reference is required.

The expression supplying the target must evaluate to a value of a suitable type. The given expression cannot possibly do so.

Correct the syntax of your ESQL expression in node '.TESTFLOW_Compute.Main', around line and column '30.7', then redeploy the message flow."

The database and table names are valid in my environment and available through intellisensce as well.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue May 19, 2009 5:22 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Now we're getting to it....

omerakhter wrote:

"BIP2497E: (.TESTFLOW_Compute.Main, 30.7) : Illegal data type for target. A list field reference is required.


Have you searched to try and better understand what this error could mean?
Back to top
View user's profile Send private message
mgk
PostPosted: Tue May 19, 2009 8:47 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

SELECT returns a list. You are assigning the list to a ROW directly, which would imply multiple ROWs, rather than multiple children of the single ROW which is what you actually want. Try this:

SET TEMP.FOO[] = SELECT ITEM T.TID FROM Database.ORCL.UPDATE_VIEW AS T;
_________________
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
omerakhter
PostPosted: Tue May 19, 2009 10:01 pm    Post subject: Reply with quote

Novice

Joined: 19 May 2009
Posts: 22

Thanks, it works

Could change the data type of TEMP to make my statement work? Is there any list data type?
Back to top
View user's profile Send private message
omerakhter
PostPosted: Tue May 19, 2009 10:09 pm    Post subject: Reply with quote

Novice

Joined: 19 May 2009
Posts: 22

Or array?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 20, 2009 5:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

ROW type is what you want.

You could use TEMP.[] instead of TEMP.FOO[].

But TEMP[], as MGK said, is an array of ROWs, and you've only got one.

There's no such thing as a ROW ROW type. Too many people would make one named BOAT, and we can't have that.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 20, 2009 5:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
There's no such thing as a ROW ROW type. Too many people would make one named BOAT, and we can't have that.


Is that a data stream.....?
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » ESQL SELECT with ITEM doesnt work
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.