01-30-2015 04:36 PM
I'm using MySQL database to log results of execution in TestStand. Stored procedures are used for all results logging. The very first procedure logs the general execution specific information and returns an auto-incremented index for ExecutionID, that index is used by other procedures during the execution as an unique execution identifier. I had some troubles initially with getting this index into TestStand, but after upgrading to ODBC 5.3 driver it was resolved and I got the out parameter from my procedure and put it into propagated local in TestStand.
Now the mistery. If executed once, everithing works fine, for the UUT Loop execution MySQL does not accept the same variable name again.
The error I'm getting is:
An error occurred calling 'LogMultipleResults' in 'ITSDBLog' of 'zNI TestStand Database Logging' An error occurred executing a statement. Statement: Insert_Execution. Description: [MySQL][ODBC 5.3(a) Driver][mysqld-5.6.16-enterprise-commercial-advanced-log]OUT or INOUT argument 14 for routine Results_Database.Insert_Execution is not a variable or NEW pseudo-variable in BEFORE trigger Number: -2147467259 NativeError: 1414 SQLState: S1000 Reported by: Microsoft OLE DB Provider for ODBC Drivers Source: TSDBLog
MySQL return such kind of error if you, say, provide a constant as an output parameter instead of a valid variable name. So, it does not want to use a "stale" variable which was already used once during the execution. I do not see such things when MySQL procedures with OUT parameters are used by other MySQL procedures, so I suppose this is something between MySQL and TestStand. I've tried to use an array to store my execution ids for different loops and to use a new element for each loop, but I get the same error. Any ideas?
02-02-2015 04:26 PM
Hi Sergey,
What version of TestStand are you using? It may also be useful to include any portions of your application if possible
I'm at a loss as to why you would be seeing this behavior. I doubt this will tell you anything helpful, but I threw in a couple of links to check out on the off chance you've configured something incorrectly:
Preparing to Implement Database Logging:
http://zone.ni.com/reference/en-XX/help/370052M-01/tsfundamentals/infotopics/database_logging/
Database Known Issues:
http://zone.ni.com/reference/en-XX/help/370052M-01/tsfundamentals/infotopics/database_known_issues/
Adding TestStand Results to a MySQL Database (this one's pretty dated):
http://www.ni.com/tutorial/3604/en/
Throw out any contextual information that might help give away where/why the error is occuring.