"SELECT count(*) FROM PIpoint WHERE Tag IN('tag1','tag2','tag3')"@
If tag 3 doesn't exist but the first two do the query fails instead of returning 2 results.
c# Error Received: ERROR [HY000] [OSI][PI ODBC][PI]Tag < tag3 > not found.
Thanks for posting on PI Square.
I tried to replicate the issue using PI SQL Commander with the same exact SQL. Unfortunately, I was successful in my implementation:
Just to make sure, I changed the query to display all the valid tags:
Again we can see that the query ignores the 'a' tag (fake)
Based on the information you have provided, I suspect that you are using PI ODBC Client. If that is the case, is there a reason to use the extremely old software? Would an upgrade to the latest software be more appropriate in this situation (PI OLEDB Provider)
I'll have to look into the OLEDB Provider. This code will be used at several location so I will have to make sure it is installed there too. I will let you know how it works
You could still use the PI ODBC Driver, as opposed to the PI ODBC Client. The PI ODBC driver uses the PI SQL Data Access Server to communicate to the PI OLEDB Provider (data archive) or PI OLEDB Enterprise (AF) which it uses as a backend. Because of that, the query above returns the same results using the PI ODBC driver as the results that Jesse mentioned with the PI OLEDB Provider.
If you have an ODBC application, then you wouldn't need to change the application itself to use OLEDB. Since our ODBC driver uses OLEDB as a back end, I would recommend it as it's more native to the PI Server.
And finally, if you have a lot of application servers, then one thing you gain from using PI ODBC driver is that you can have one central server running PI OLEDB Provider/Enterprise and the PI SQL Data Access Server service, and all of the ODBC applications on different machines (using the PI ODBC driver) can utilize the one central OLEDB server for all their "heavy lifting".
Let us know if you have any questions about the implementation of PI OLEDB and PI ODBC driver.
I was curious if moving to the OLEDB provider resolved the error you were getting.
Retrieving data ...