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 » is FETCH supported in ESQL for the SELECT against DB2

Post new topic  Reply to topic
 is FETCH supported in ESQL for the SELECT against DB2 « View previous topic :: View next topic » 
Author Message
sknrt1
PostPosted: Wed Oct 18, 2006 6:56 am    Post subject: is FETCH supported in ESQL for the SELECT against DB2 Reply with quote

Apprentice

Joined: 22 Jan 2003
Posts: 39
Location: USA

Broker Version: WMB v6

I have a req to get only First few records of the SELECT Query from DB2.
SELECT with FETCH works in DB2, but not from ESQL, so is FETCH supported as in SQL?

e.g:
SELECT * from table FETCH FIRST 100 ROWS ONLY;

works in database.

but the same statement doesn't work in ESQL, toolkit compile fails when FETCH is included in SELECT statement. Are there any other approaches to do it the ESQL itself, than having it as an external Stored Procedure or so...

Thanks in Advance
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 18, 2006 7:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05620_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Yaroslav
PostPosted: Wed Oct 18, 2006 9:58 am    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12
Location: Russia

Hi, sknrt1!

It's no structure like "FETCH FIRST N ROWS ONLY" in ESQL SELECT statement.

If you want to get the same effect you can use
PASSTHRU(<Database specific SQL>)
or
Create DB2 stored procedure which return result set based on your
select statement and declare this SP as EXTERNAL PROCEDURE in ESQL.
_________________
IBM Certified Solution Designer WebSphere MQ V6.0
IBM Certified Solution Developer WebSphere Message Broker V6.0
Back to top
View user's profile Send private message
sknrt1
PostPosted: Wed Nov 15, 2006 7:24 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2003
Posts: 39
Location: USA

FETCH works, initially i had a wrong query.
Any way thanks a lot for the info.
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 » is FETCH supported in ESQL for the SELECT against DB2
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.