Notes and its fields in sql

Other discussions about CSPro
Post Reply
AriSilva
Posts: 352
Joined: July 22nd, 2016, 3:55 pm

Notes and its fields in sql

Post by AriSilva » March 24th, 2020, 12:36 pm

Using the dataviewer to look at a questionnaire I noticed that, at the end, it shows the notes fields, as the interviewers filled them. That´s very good!
I can see also that the fields having notes are marked in yellow and if you move the cursor over it you can see the notes´contents, which is also very good.
I have some questiona about the last two columns in the Notes table:
1. Operator ID. Where does it comes from? That is, how is it filled with? Is it possible to assign a value to that? One of the variables in my dictionary´s application holds the operator´s CPF (similar to your Social Security Number). Can I copy it to the operator ID?
2. Date/Time. I see the Notes table in SQL that it has a modified_time field. Is it the one storing the date AND the time? In what base?
One example is that the contents is 1581871493 (in SQL) and it "translates" to 2/16/2020 1:44:53 PM in the dataviewer. Is that correct, or this field has only the time and the date comes from another field?

By the way, I can click in any field from the "regular" records, the field is highlighted and I can copy (Ctrl_C) it. But clicking in the notes it highlights the whole line, I cannot copy it, and I do not know why, the dataviewer is crashing.
If you want to have look at it I´m attaching the csdb, look at 3109006999999970396. It is only a test example.
Best
Attachments
BRUMA_10_Entrevista_DMC_Ari_2.zip
(103.52 KiB) Downloaded 5 times
Best
Ari

Gregory Martin
Posts: 1309
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Notes and its fields in sql

Post by Gregory Martin » March 24th, 2020, 1:24 pm

1) This is the operator ID that the user can enter (https://www.csprousers.org/help/CSPro/c ... tions.html). If you want to set it via logic, you can use the setoperatorid function.

2) This is a UNIX time value, which contains both the date and time. You can work with times in CSPro logic using the timestamp and timestring functions.

Data Viewer has been completely rewritten for CSPro 7.4, so hopefully any crashes will go away in this next version. :)

AriSilva
Posts: 352
Joined: July 22nd, 2016, 3:55 pm

Re: Notes and its fields in sql

Post by AriSilva » March 25th, 2020, 6:58 pm

Thanks, Greg, it worked, both the operator_id and the modified_time.
But I could not set the operatorId using the setoperatorid() function.
I used it at the _FF form preproc, but the operatorID was always blank.
...
PROC BRUMA_10_ENTREVISTA_FF
preproc
string x = "something";
setoperatorid(x);

The only way to set it was generating the PFF using the OperatorId parameter
...
pff executa;
executa.setproperty("DataEntryInit.OperatorID", cpfString); //2020.03.25 CPF usado como operatorID
Best
Ari

Gregory Martin
Posts: 1309
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Notes and its fields in sql

Post by Gregory Martin » March 26th, 2020, 8:32 am

Can you send your test application where you set this in logic? If you look at the attached file, I've included an application that sets the operator ID in the _FF form preproc and it works correctly in my testing.
Attachments
operator-id.zip
(2.36 KiB) Downloaded 9 times

AriSilva
Posts: 352
Joined: July 22nd, 2016, 3:55 pm

Re: Notes and its fields in sql

Post by AriSilva » March 30th, 2020, 4:28 pm

Sorry, but I could not reproduce the error using setoperatorid.
I´ve made a very small app and it worked. Probably (certainly) my mistake mishandling my test files.
Best
Ari

Post Reply