03-18-2010 11:36 AM
Hello everyone--
I am getting the following Database Logging error ONLY on String-Value Type statements. As a note, I have generated a custom schema : ACA UTS Generic Insert and it works fine for all other step types.
An error occurred calling 'LogResults' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Schema: ACA UTS Generic Insert
Statement: PROP_RESULT.
Description: Data type mismatch in criteria expression.
Number: -2147217913
NativeError: -539888598
SQLState: 3464
Reported by: Microsoft JET Database Engine
Source: TSDBLog
Anyone have a starting point where I could look to find out more information what might be wrong?
Thanks,
Paul Holzrichter
03-19-2010 05:18 AM
03-19-2010 08:22 AM
The error comes about due to the fact that the 'Property Result' table created contained a DATA column that was actually a number NOT a string. The reason this occurred will be explained shortly....
For my environment I initially copied a schema and renamed it to ACA UTS Generic Insert.... I added a couple of new tables and new columns to the schema. When I went to the 'Schema's tab and clicked on Validate against my empty database it noticed that all the tables were NOT found. Then I selected the 'Build .sql File...' button and created the SQL File. Opening the SQL file, I noticed the following:
2+ statements to create the PROP_RESULT table!!!
CREATE TABLE PROP_RESULT (
ID GUID CONSTRAINT TABLE_CONSTRAINT PRIMARY KEY,
STEP_RESULT GUID,
PROP_PARENT GUID,
ORDER_NUMBER Long,
NAME VarChar(255),
PATH LongText,
CATEGORY Long,
TYPE_VALUE Long,
TYPE_NAME VarChar(255),
DISPLAY_FORMAT VarChar(32),
DATA Double,
CONSTRAINT STEP_NUMERICLIMIT1_FK FOREIGN KEY (STEP_RESULT) REFERENCES STEP_RESULT (ID))
CREATE TABLE PROP_RESULT (
ID GUID CONSTRAINT TABLE_CONSTRAINT PRIMARY KEY,
STEP_RESULT GUID,
PROP_PARENT GUID,
ORDER_NUMBER Long,
NAME VarChar(255),
PATH VarChar(255),
CATEGORY Long,
TYPE_VALUE Long,
TYPE_NAME VarChar(255),
DISPLAY_FORMAT VarChar(32),
DATA VarChar(255),
CONSTRAINT PROP_MULTINUMERICLIMIT1_FK FOREIGN KEY (STEP_RESULT) REFERENCES STEP_RESULT (ID),
CONSTRAINT PROP_MULTINUMERICLIMIT1_FK FOREIGN KEY (PROP_PARENT) REFERENCES PROP_RESULT (ID))
So when I ran the Execute SQL command in the Database Viewer, it created the PROP_RESULT table based on the first SQL command it found, and made the DATA column a DOUBLE instead of a string.
My conclusion is that with my limited knowledge of SQL I did not notice that the file had multiple statements to create the tables. I modified the NI SQL file for the NI Insert Command to add my custom items and everything worked correctly.
Paul