Problem:
Sometimes you may see below error if you are using ODBC PowerPack Drivers in your Apps (e.g. SQL Server / Power BI).
ERROR [HY] Query execution error: No data returned for specified table name or filter expression. Make sure table name or filter is typed correctly (it is case sensitive) and input data contains corresponding element(s).
Reason:
By default ZappySys Driver decides columns / datatype based on Data returned in the query response. If no data is returned its not possible to know columns / its datatype and this is the reason why you see above error when response contains no data.
Solution:
Solution to above problem is simple.
Specify pre generated Metadata in WITH clause of SQL query so Driver can determine columns to be returned along with its datatype when zero record found in response from the server.
See below article for more information.
https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/#Metadata_Options_in_SQL_Query
Sample Query with META clause
Method-1 (Meta from File)
select * from sometable WITH( meta='c:\temp\meta.txt' )
Method-2 (Meta from Storage)
select * from sometable WITH( meta='My-Meta-name' )
Method-3 (Embedded Meta)
/*allowed types are String, Int64, Long, Int, Int32, Short, Byte, Decimal, Double, Float, DateTime, Date, Boolean.*/
select * from value WITH( meta='[
{
"Name": "CustomerName",
"Type": "String",
"Length": 255
},
{
"Name": "CustomerID",
"Type": "String",
"Length": 10
},
...........
...........
...........
]' )
Contact Us
If you have more question(s) feel free to contact us via Live chat or email to support@zappysys.com
Comments
0 comments
Please sign in to leave a comment.