ODBC Driver SQL Limit Alternative

Posted by drew_sav on 20-Oct-2010 22:21

Hi guys,

I'm writing a website that accesses web services from OpenEdge 10.1B/C databases. I'm using the ODBC driver, and am having a few issues getting an SQL select statement with a limit clause working. The statement is generally:

select PUB.Inventory.* from PUB.Inventory order by  PUB.Inventory.innumber desc limit 60, 20

Which provides the following error:

ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about "limit 60, 20" (10713)

I have tried multiple variations of using the limit clause, but they all fail. As soon as i remove the limit clause the statement executes fine, returning a large result set. I'm assuming that the Limit clause is not supported by the OpenEdge ODBC driver. What i would like to know is if there is any way to get this functionality? I've also tried the following statement, using the Top clause:

select top 20 PUB.Inventory.* from PUB.Inventory where PUB.Inventory.inid not in (select top 60 PUB.Inventory.inid from PUB.Inventory order by PUB.Inventory.innumber desc) order by PUB.Inventory.innumber desc

Which gives the following error:

ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]TOP clause used in unsupported context. (13694)

Has anyone been able to do this? Surely there must be a way!

All Replies

This thread is closed