"Select top" on Progress OpenEdge 10.1a

Posted by Admin on 22-May-2007 14:41

Hi all,

I need to do a SELECT TOP 1 FROM table ORDER BY field ID. I'm working with progress 10.1a.

However, "SELECT TOP x" is not recognize.

Is there a workaround?

Thank's for your help

All Replies

Posted by Thomas Mercer-Hursh on 22-May-2007 17:18

SELECT TOP n is supported in 10.1B .... not sure when it was introduced, but it hasn't been long. Prior to that, the only workaround was setting the fetch limit, which is a session parameter, not a parameter on an individual SELECT.

Posted by Admin on 23-May-2007 06:30

thanks for your help, but this solution won't solve my problem.

I will try another approach to do this. could anyone suggest any other to me?

Thanks again

Posted by Tim Kuehn on 23-May-2007 07:00

thanks for your help, but this solution won't solve

my problem.

I will try another approach to do this. could anyone

suggest any other to me?

Use the 4GL ... er ABL.

Posted by Thomas Mercer-Hursh on 23-May-2007 11:23

Is there a reason you can't upgrade to 10.1B?

Posted by Admin on 23-May-2007 11:57

Hi Thomas,

I work in a company of software development, and the DataBase was a choose of our customer. Our customer already used the 10.1B, but they had to come back to use the previous version, 10.1A. I am unaware of the reason.

Thanks Thomas

Posted by Thomas Mercer-Hursh on 23-May-2007 12:18

Well, possibly it would be a thing to ask about. I know of no reason to have to use 10.1A over 10.1B and a great many reasons to use 10.1B over 10.1A ... including TOP. There really isn't any equivalent functionality using SQL prior to TOP. One can adjust fetch limit, as I mentioned, and that has the same effect, but is not terribly convenient unless you are using a tool like Actuate where this can be built into the individual query. For naked SQL, it is a session quality and thus a bit awkward. If you are wrapping the SQL in VB or .NET, perhaps you can adjust the fetch limit there, but that is not something I know about. Likewise, other reporting products might have this capability. But, naked SQL, you need TOP. Period. Perhaps there is something one can do with cursors ... I avoid writing that kind of SQL ... but whatever it is, it will be a kludge which you would want to rip out and replace with TOP the instant you are on 10.1B.

This thread is closed