[NDB_BVL_Instrument] Fix for clearing instrument
Brief summary of changes
- When running clear instrument on a non JSON instrument with non NULLABLE fields, it tries to set values to null which results in an error, this is resolved
Testing instructions (if applicable)
- Set a field of an instrument to NULLABLE = 'NO' in information_schema
- Try clearing the instrument with the LORIS API, see that it works now
I am confused.. how does an instrument get non-nullable fields? What is the value before data entry is done?
I am confused.. how does an instrument get non-nullable fields? What is the value before data entry is done?
CommentID is a non-nullable field. When using the clear instrument function it results in an error as it tries to set the CommentID to null.
Should the check be and FIELD_NAME != CommentID then? I'm afraid of what might happen if a different column has a non-null constraint and it just doesn't get cleared but the user thinks it does. At least if there's an error they would know there's something that went wrong to report.
@driusan Yeah I can change it to that