forcase in sequential order

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

forcase in sequential order

Post 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
Best
Ari
Gregory Martin
Posts: 1774
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: forcase in sequential order

Post 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.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: forcase in sequential order

Post 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.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: forcase in sequential order

Post 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,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply