Using SQL query
Using SQL query
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.
Re: Using SQL query
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
<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
Re: Using SQL query
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
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