Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI SQL Client ODBC

Comparison with numeric values

  • Last UpdatedJan 04, 2023
  • 1 minute read

Comparison with numeric values causes post-processing, so the query execution is slowed down.

For example:

SELECT e."Name" Element, ea."Name" Attribute,
ea."Value", ea."Value_Double"
FROM Element.Element2@pi e
INNER JOIN Element.Attribute2@pi ea ON ea."ElementID" = e.ID
WHERE e."Name" = 'Houston'
AND (ea."Name" = 'Environment' OR ea."Name" Like 'Plant%')
AND ea."Value" > 50
ORDER BY e."Name", ea."Name";

As long as the intermediate result contains only numeric data for the value column, post-processing will generate correct results. However, if there are non-numeric strings in the intermediate result, post-processing will generate an ORA-01722: invalid number error message.

Related Links
TitleResults for “How to create a CRG?”Also Available in