If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > selecting records in a given range.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-15-06, 10:49
vinod nayak vinod nayak is offline
Registered User
 
Join Date: Jun 2006
Posts: 3
selecting records in a given range.

Hi All,

I am Vinod and joined this group today. I need some help on Db2 queires to be executed in the stored procedures.

When i run this query [I got this format of query from this site itself] in the command center [7.x ver], I get the following error message.

--------------------------- Command entered ----------------------------
WITH RANGETEST AS
(SELECT GGX_GROUP, ROW_NUMBER OVER (ORDER BY GGX_GROUP_ID) AS RN
FROM tggx_generic_group)
SELECT GGX_GROUP, RN
FROM RANGETEST
WHERE RN BETWEEN 2 AND 7
------------------------------------------------------------------------
SQL0104N An unexpected token "(" was found following "". Expected tokens may
include: ", FROM INTO". SQLSTATE=42601

Thanks in advance, Vinod
Reply With Quote
  #2 (permalink)  
Old 06-15-06, 10:52
vinod nayak vinod nayak is offline
Registered User
 
Join Date: Jun 2006
Posts: 3
Hi All,

I forgot to mention one more thing.

Even if i give " ROW_NUMBER() ", i get the same message.

Regards, Vinod
Reply With Quote
  #3 (permalink)  
Old 06-17-06, 17:58
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Try executing this query with DB2 version 8.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On