Using a start index on a FOREACH query

Posted by Boy on 18-Mar-2013 03:38

Hi Folks,

Im pretty new to ABL/Progress so bare with me, i have written a query program that uses a FOREACH to gather results from a database.

I've build in a MAX-ROWS syntax to determin how many results i want MAX, the only thing that is missing is a sort of start index in where i can say i want 10 items starting from row 20 so the resulting items would be item 20 till 30.

Is this posible to do within the QUERY like the MAX-ROWS statement i used as in "FOREACH "x" MAX-ROWS 10 START-INDEX 20 : ?

Kind regards,

BK

All Replies

Posted by rohit.ramak on 18-Mar-2013 22:53

You could either send your "filtered" data to temp-table and process the records in the temp-table or

DEFINE VARIABLE iCnt AS INTEGER     NO-UNDO.

FOR EACH Customer NO-LOCK

iCnt = 1 TO 30 BY 1 :

IF iCnt

/*      process record #    20 to30 here */


END.

Posted by Boy on 19-Mar-2013 04:46

Hi Rohit,

Thanks for the effort but this is exacly what i don't want, i was hoping for a native statement,

Now, when i want to have records 30 till 40 from a FOR EACH statement i have to get 0 till 40 and move 30 till 40 to a temp table or something. i am stunned that ABL has no native support for this feature.

Unless anyone else tells me otherwhise.

Cheers

BK

Posted by Admin on 19-Mar-2013 05:16

Unless anyone else tells me otherwhise.

 

Checkout:

DEFINE QUERY

OPEN QUERY

REPOSITION TO ROW

Posted by Jens Dahlin on 19-Mar-2013 07:54

Also: download the gigantic PDF documentation (you can find it here under "documents") and check out the ABL Essentials, ABL Reference etc. You'll learn a lot!

Posted by andrew.thornton@redprairie.com on 19-Mar-2013 07:56

Sorry I missed your email. I am out of the office until Thursday 21st March with little access to email. If your email is related to a support issue please contact the support team on 0113 821 3333.

Thanks, Andrew

Posted by robw@hltool.com on 19-Mar-2013 08:01

Whomever adds an email submission filter that ignores emails containing "out" and "office" wins a prize!

Posted by Jens Dahlin on 19-Mar-2013 09:53

MATCHES "*out of office*" OR MATCHES "*out of the office*" should suffice. I must assume that they run this board in pure ABL.

Posted by robw@hltool.com on 19-Mar-2013 10:26

Unfortunately I think it's salesforce.com. ABL would have worked fine...

This thread is closed