Using SQL query

Discussions about CSEntry
Post Reply
szso
Posts: 17
Joined: January 10th, 2015, 5:26 am

Using SQL query

Post by szso »

Is it possible to use SQL query in CSPro? for e.g. in auto increment ID field: look for the max number in ID field and automatically add 1 for each new case.
szso
Posts: 17
Joined: January 10th, 2015, 5:26 am

Re: Using SQL query

Post by szso »

What I really mean is that if we have 2 variables as primary key <letter, number>.
<A,1> is the value from the first case. If you add a case with A as letter, the number 1 will automatically increase to 2.
If you change the letter in primary key into B, the number will start with 1 again (<B,1>) and so on.
I do not know if you understand.
And if I have 5 variables as primary key and I would like the last digit to vary according to changes of the 4 variables before, how could I manage that?
Thanks
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Using SQL query

Post by josh »

CSPro doesn't support SQL querying. The closest function is loadcase but that only works on external data files and doesn't handle anything like a max query. For that you would have to write logic to run through the whole data file using loadcase and compute the max yourself.

You might be able to use a combination of persistent fields and logic to do what you want. See these posts:

http://csprousers.org/forum/viewtopic.php?f=1&t=546
http://csprousers.org/forum/viewtopic.php?f=1&t=844
Post Reply