Querying wide tables in delta retrieval mode
- Last UpdatedMar 19, 2025
- 1 minute read
Wide tables in delta retrieval mode will behave normally if only one tag is returned. However, for a multiple tag display, a complete row is returned to the client for each instance in which one or more of the tags in the query returns a different value. The row will reflect the actual values being returned for the tags returning results, and will reflect the previous values for the remaining tags in the result set (similar to cyclic retrieval).
Note: The value can be "invalid" or some other quality value.
The following query returns values for three tags from the WideHistory table. "MyTagName" is a tag that periodically is invalid.
SELECT * FROM OpenQuery(INSQL,'
SELECT DateTime, SysTimeSec, SysTimeMin, MyTagName
FROM WideHistory
WHERE DateTime >= "2001-05-12 13:00:00"
AND DateTime <= "2001-05-12 13:02:00"
AND wwRetrievalMode = "Delta"
')
The results are:
|
DateTime |
SysTimeSec |
SysTimeMin |
MyTagName |
|
... |
|||
|
2001-05-12 13:00:55.000 |
55 |
00 |
1 |
|
2001-05-12 13:00:56.000 |
56 |
00 |
1 |
|
2001-05-12 13:00:57.000 |
57 |
00 |
1 |
|
2001-05-12 13:00:57.500 |
57 |
00 |
null |
|
2001-05-12 13:00:58.000 |
58 |
00 |
null |
|
2001-05-12 13:00:59.000 |
59 |
00 |
null |
|
2001-05-12 13:01:00.000 |
00 |
01 |
null |
|
2001-05-12 13:01:00.500 |
00 |
01 |
2 |
|
2001-05-12 13:01:01.000 |
01 |
01 |
2 |
|
2001-05-12 13:01:02.000 |
02 |
01 |
2 |
|
2001-05-12 13:01:03.000 |
03 |
01 |
2 |
|
... |
Notice that 57 appears twice since the occurrence of 1 changing to NULL for tag "MyTagName" occurs sometime between the 57th and 58th second. The same applies for NULL changing to 2. The same behavior applies to discrete values.