Any comments added to data points will be available to be consumed, including comments added to historical data points that might have already been consumed. All measure value data will also be available with the comments data.
In addition to the measure value placeholders, the following placeholders can be used with regard to comments:
|
This will be replaced by the comment entered against the measure time period. |
|
This will be replaced by the timestamp for the comment had been entered. |
|
This will be replaced by the UTC timestamp for the comment had been entered. |
|
This will be replaced by the measure value ID for the comment which it had been captured against. |
|
This will be replaced by the measure time period ID that the comment had been captured against. |
|
This will be replaced by the username entered for the comment. If no value is found, it will be replaced by a blank string (“”). |
|
This will be replaced by the unique username ID that was entered for the comment. If no value is found, it will be replaced by a NULL value. |
Microsoft SQL Example
update Comments set Comment = '[MeasureComment]' where DateTime='[MeasureCommentDateTime]' IF @@ROWCOUNT=0 insert into Comments (Comment, DateTime, TimePeriodId, UserName, MeasureId) values ('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID], '[MeasureCommentUsername]', [MeasureID])
MySQL Example
update Comments set Comment = '[MeasureComment]' where DateTime= '[MeasureCommentDateTime]' IF @@ROWCOUNT=0 insert into Comments (Comment, DateTime, TimePeriodId, UserName, MeasureId) values ('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID], '[MeasureCommentUsername]', [MeasureID])
PostgreSQL Example
do $$ begin update schema.""Comments"" set ""Comment""= '[MeasureComment]' where ""DateTime""='[MeasureCommentDateTime]' IF NOT FOUND THEN insert into schema."" Comments "" (""Comment "", ""DateTime"", "" TimePeriodId"", "" UserName"","" MeasureId "") values ('[MeasureComment]', '[MeasureCommentDateTime]',[MeasureCommentMeasureTimePeriodID], '[MeasureCommentUsername]', [MeasureID]) end if; end $$