Page 1 of 1

forcase in sequential order

Posted: September 4th, 2018, 7:31 pm
by AriSilva
I would like to use the forcase statement using an external file in the order the records were created, not the indexed order, as in the pff where you can state the order.
Like forcase dict where ... order [indexed, sequential];
The default would be indexed, as it is now.
Or have another option in the set access statement.
set access (dict) [ascending, descending, sequential];
Best
Ari

Re: forcase in sequential order

Posted: September 5th, 2018, 2:12 pm
by Gregory Martin
This is advanced, but you could fill in a list with the sequential keys be using the SqlQuery function with this query:

SELECT key FROM cases ORDER BY file_order;

Then you could loop through those keys and use the find/loadcase functions to process them in file order.

Re: forcase in sequential order

Posted: September 5th, 2018, 2:24 pm
by josh
Note that Greg's suggestion will work for csdb files generated by versions 7.0 and 7.1 of CSPro but there is guarantee that it will work in csdb files generated by future versions of CSPro. In other words, we may change the schema of the database in the csdb files in the future so doing sql queries on the csdb may break if we do that.

Re: forcase in sequential order

Posted: September 7th, 2018, 4:10 pm
by htuser
Hi Josh,
Thank you for informed us about future changes and improvements.
Since Greg informed us month ago: http://csprousers.org/forum/viewtopic.p ... 592&p=8544
that sqlquery could be able to be used on items and record in the future, i think that, changes in the schema will not be an issue.
As you can imagine, query the csdb file allow users to solve multiples issues more easily.
Severals times, Greg advise to use sqlquery to solve some problems.

Best Regards,