Recommendation for variant columns
- Last UpdatedJan 04, 2023
- 1 minute read
- PI System
- PI SQL Client ODBC 2021
- Developer
As long as the converted Variant column does not need to be constrained, the workaround provided, Variant as String, is sufficient. All data will be provided as strings, and visualization and reporting tools will have no problems.
When constraints must be applied to such columns, it is recommended that you create or use PI SQL Views that explicitly cast the Variant column to a native data type (such as String, Float, and so on.) When the TO_NCHAR capability is enabled, for strings, the Unicode type (String) should be used. When the TO_NCHAR capability is disabled, for strings, the ASCII type (AnsiString) should be used.
Note: The Attribute and data tables do already have native data type value columns (Value_Int, Value_Double, Value_String (Unicode), and so on).