04-17-2018 01:03 PM - edited 04-17-2018 01:05 PM
Hi all,
I'm totally stumped and I'm hoping someone here might be able to help me out.
I'm trying to log five custom values in each STEP_RESULT record. I have a model plugin that I've customized to add these values to each step result.
Parameters.ThisResult.NewSubProperty("NewContainer",PropValType_Container,False,"",PropOption_DoNothingIfExists), Parameters.ThisResult->NewContainer.NewSubProperty("Temperature",PropValType_Number,False,"",PropOption_DoNothingIfExists), Parameters.ThisResult->NewContainer.Temperature = <the temperature, gleaned from elsewhere>
I do the same with the other values. Then I drop a breakpoint at the LogToDatabase callback in the database plugin. I can see in each MainSequence result that NewContainer is being populated and the values are there when the plugin logs to the database. So far so good.
I've set up a custom schema such that the new fields I want are added to the STEP_RESULT table.
STEP_RESULT = Logging.StepResult.NewContainer.Temperature
No matter what I do the columns show up as NULL in my SQL Server database. I know for a fact that the values are populated at run-time, I know the schema references the correct variables. No run-time errors occur when the results are logged.
I tried removing the database plugin and adding it again to force the configuration to load.
I've double checked the schema. For each field/column I haven't set any precondition, and I've set the "Expected Properties" expression to the same as the variable referenced.
I tried using attributes attached to each step result, too, but observed the same outcome.
Nothing seems to get me where I need to be.
What am I missing?
Thanks,
Mr. Jim
Solved! Go to Solution.
04-17-2018 04:57 PM
Okay, I think I've substantially simplified the issue - I've gotten almost everything working. The last hurdle to overcome is the following:
(Sorry for the rambling nature of this post)
I have a field of "Date/Time" that is going into SQL server. Even if I manually enter the following:
It shows up in SQL server as "2017-01-23 16:45:12.000"
Does anyone know how to get the fractional seconds working properly?
Thanks again,
Mr. Jim
04-18-2018 06:00 PM
I have the following option on my SQL Server Stored
04-19-2018 07:11 AM
Which datatype does your column have in SQL? I think that by default TIMESTAMP type has no fractional seconds.
Please refer to this webpage for further info on this topic.
04-19-2018 12:21 PM
Hi Andres and Norbert,
Thank you very much for your replies - those were great hints. I'd been staring at this too long and had been getting tunnel vision. I feel silly having missed that obvious possibility - I kept assuming that it was something I was doing wrong on my end!
Apparently the field in the table has been indeed set to a datatype that does not include fractional seconds.
The better news for me is that, upon finding this out, the party supplying me with requirements conceded that we don't need fractional seconds, so that requirement has now been eliminated.
Thank you again for your help and for enduring my esoteric and vague posts.
Mr. Jim