progress-4gl

How to mimic SELECT … LIMIT, OFFSET in OpenEdge SQL?

爷,独闯天下 提交于 2019-12-01 23:21:14
It's a common thing in most SQL implementations to be able to select a "sliding window" subset of all the rows returned in a query. A common use case for this is pagination. For example, say I have a search page with 10 results on each page. For implementations that support LIMIT and OFFSET keywords, the query used to return results for each page would be as follows: page one would use SELECT ... LIMIT 10 OFFSET 0 , page 2 would use SELECT ... LIMIT 10 OFFSET 10 , page 3 would use SELECT ... LIMIT 10 OFFSET 20 , etc. (note that the OFFSET takes effect before the LIMIT ). Anyway, I'm trying to

How to mimic SELECT … LIMIT, OFFSET in OpenEdge SQL?

落花浮王杯 提交于 2019-12-01 22:40:29
问题 It's a common thing in most SQL implementations to be able to select a "sliding window" subset of all the rows returned in a query. A common use case for this is pagination. For example, say I have a search page with 10 results on each page. For implementations that support LIMIT and OFFSET keywords, the query used to return results for each page would be as follows: page one would use SELECT ... LIMIT 10 OFFSET 0 , page 2 would use SELECT ... LIMIT 10 OFFSET 10 , page 3 would use SELECT ...

Getting first 100 records from the table in Progress OpenEdge database (e.g. SELECT TOP 100..)

[亡魂溺海] 提交于 2019-11-29 14:07:14
How can I get a limited number of records from the table in Progress OpenEdge database? Something like in SQL: SELECT TOP 100 * FROM MyTable The only ugly solution I can find is looping through all records and breaking when 100 of them were displayed. But feels like there should be some better way of doing it. If you are using the 4GL you might also want to look at using OPEN QUERY and MAX-ROWS to achieve the result that you are looking for. The following shows a traditional FOR EACH loop with a counter and then a QUERY with MAX-ROWS: define variable i as integer no-undo. define frame a with

Getting first 100 records from the table in Progress OpenEdge database (e.g. SELECT TOP 100..)

China☆狼群 提交于 2019-11-28 07:44:42
问题 How can I get a limited number of records from the table in Progress OpenEdge database? Something like in SQL: SELECT TOP 100 * FROM MyTable The only ugly solution I can find is looping through all records and breaking when 100 of them were displayed. But feels like there should be some better way of doing it. 回答1: If you are using the 4GL you might also want to look at using OPEN QUERY and MAX-ROWS to achieve the result that you are looking for. The following shows a traditional FOR EACH