@Luigi Navarra - It seems like you are trying to use parameterized queries with Simba Spark ODBC driver v2.8.0 to query data from your Azure Databricks SQL warehouse into a .NET 8 ASP.NET API app. However, you are encountering an error message that says "Found the unbound parameter: _119. Please, fix args
and provide a mapping of the parameter to either a SQL literal or collection constructor functions such as map()
, array()
, struct()
. SQLSTATE: 42P02; line 3 pos 43".
This error message indicates that there is an unbound parameter in your query. To fix this error, you need to provide a mapping of the parameter to either a SQL literal or collection constructor functions such as map()
, array()
, struct()
.
Regarding your question about passing LIMIT and OFFSET values as parameters, it is not possible to pass them as parameters in a parameterized query. However, you can use string interpolation to generate the query dynamically at runtime. Please note that using string interpolation can expose your application to SQL injection attacks if you do not properly validate and sanitize user input.
It seems that the wildcard "?" does not work with OFFSET in the ODBC driver you are using. As you have mentioned, you can use string interpolation to generate the query dynamically at runtime and use a .NET library to validate data and prevent SQL injection attacks.
Using plain text strings, you can also use Dapper ORM over the ODBC driver. Dapper is a lightweight ORM that provides a simple way to map database results to objects. It can help you write cleaner and more maintainable code.
I'm glad that I could help. Let me know if you have any further questions or concerns.
I hope this helps! Let me know if you have any further questions.