SET Variables
The following table outlines the supported SQL variables and settings that you can use in a SET
statement. If you do not change any variables using the SET
statement or a WHERE
clause in your SELECT
statement, the Historian OLE DB Provider assumes default session variables. You can apply any of the variables described in the following table to the current session. In turn, these settings are used when retrieving information from the Historian database tables. SET
variables persist from statement to statement.
SET
statement accept abbreviations. You must type at least the abbreviation for the statement to work. For instance, for the CalculationMode
setting you can enter the abbreviation Interp for the Interpolated
setting. As a minimum, you have to at least enter the letters Interp as the abbreviation for the CalculationMode
. The accepted abbreviations are highlighted in bold in the following table.Variable | Description |
---|---|
StartTime | A valid date and time string, such as:
|
EndTime | A valid date and time string, such as:
|
SamplingMode | String that represents the mode of sampling data from the archive:
Calculated |
Direction | String that represents the direction of data sampling from the archive, beginning at the start time. Direction applies to the RawByTime and RawByNumber sampling modes:
Forward |
NumberOfSamples | Any positive integer that represents the number of samples from the archive to retrieve. Do not enter a thousands separator. For example, enter 1000 and not 1,000. Samples are evenly spaced within the time range defined by start and end times for most sampling modes. For the Default Setting:
|
IntervalMilliseconds | Any positive integer that represents the interval (in milliseconds) between returned samples. For example:
60000 (one minute) |
CalculationMode | The CalculationMode column only applies if the SamplingMode is set to Calculated . It represents the type of calculation to perform on archive data:
Average |
FilterTag | A valid tagname used to define the filter, if specified. For example, a FilterTag might be defined as:
Only a single tag ID can be specified in the Default Setting: An empty space (meaning |
FilterMode | String that represents the type of time filter:
For example, Default Setting:
|
FilterComparisonMode | String that represents the type of comparison to be made on the filter comparison value:
FilterTag and FilterComparisonValue are supplied in the SET statement, time periods are filtered from the results where the filter condition is False . FilterComparisonMode is used in conjunction with FilterValue , FilterMode , and FilterTag .Default Setting: |
FilterExpression | An expression which includes multiple filter conditions. FilterExpression can be used instead of FilterTag , FilterComparisonMode and FilterValue .
FilterExpression , the expression is passed within single quotes, and for complex expressions we write the conditions within a parenthesis. There is no maximum length for FilterExpression . |
FilterValue | String that represents the value with which to compare the filter tag to determine the appropriate filter times. Wildcards are not supported. Do not use a comma for the thousands separator. For example, a sample
The Default Setting: An empty space (meaning filtering is not used) |
TimeZone | String that represents the type of time zone that should be applied to timestamps:
For example, an explicit bias number of 300 represents 300 minutes from GMT. Note: Time zones are not supported on Windows 9x computers. Default Setting:
|
DaylightSavingTime | Flag that indicates whether Daylight Saving Time logic should be applied to timestamps:
|
RowCount | Positive number that indicates the maximum number of rows that can be returned. A listing of 0 indicates there is no limit to the number of rows returned.Default Setting:
|