<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ODBC Parameterization issue (Basic .NET) in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150493#M53435</link>
    <description>&lt;P&gt;I should probably add that I've tried to downgrade to the last Simba driver and that doesn't support transactions which are kinda required in my scenario. Thanks again!&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2026 13:46:09 GMT</pubDate>
    <dc:creator>DitchT</dc:creator>
    <dc:date>2026-03-10T13:46:09Z</dc:date>
    <item>
      <title>ODBC Parameterization issue (Basic .NET)</title>
      <link>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150492#M53434</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;I have some rather basic C# code that I'm running against the newest DataBricks ODBC driver, attempting to insert parameterized queries.&lt;/P&gt;&lt;P&gt;I see the option to disable parameterized queries in the documentation. UseNativeQuery=false, FastSQLPrepare=false. SparkThriftServer, OAuth with passthrough token, SSL=true, but nothing else configured.&lt;/P&gt;&lt;P&gt;I can query this and other tables just fine and I can insert with SQL literals, but parameterization seems broken.&lt;/P&gt;&lt;P&gt;Any feedback would be appreciated&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Forgive the formatting, but it's pretty much basic ODBC use with parameterized queries.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-------------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;string&lt;/SPAN&gt; &lt;SPAN&gt;sql&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"INSERT INTO test_odbc_identity (name, value) VALUES (?, ?);"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;using&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;connection&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;OdbcConnection&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;connectionString&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;connection&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Open&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;using&lt;/SPAN&gt; &lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;command&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;OdbcCommand&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPA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IV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The stacktrace isn't so helpful on my side.&lt;/DIV&gt;&lt;DIV&gt;Top-level message: ERROR [42P02] [Databricks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNBOUND_SQL_PARAMETER] org.apache.spark.sql.catalyst.ExtendedAnalysisException: [UNBOUND_SQL_PARAMETER] Found the unbound parameter: _53. 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 1 pos 53&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:49)&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.$anonfun$execute$1(SparkExecuteStatementOperation.scala:1063)&lt;BR /&gt;at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)&lt;BR /&gt;at com.databricks.unity.UCSEphemeralState$Handle.runWith(UCSEphemeralState.scala:51)&lt;BR /&gt;at com.databricks.unity.HandleImpl.runWith(UCSHandle.scala:104)&lt;BR /&gt;at org.apache.spark.[Databricks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNBOUND_SQL_PARAMETER] org.apache.spark.sql.catalyst.ExtendedAnalysisException: [UNBOUND_SQL_PARAMETER] Found the unbound parameter: _53. 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 1 pos 53&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:49)&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.$anonfun$execute$1(SparkExecuteStatementOperation.scala:1063)&lt;BR /&gt;at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)&lt;BR /&gt;at com.databricks.unity.UCSEphemeralState$Handle.runWith(UCSEphemeralState.scala:51)&lt;BR /&gt;at com.databricks.unity.HandleImpl.runWith(UCSHandle.scala:104)&lt;BR /&gt;at org.apache.spark.&lt;BR /&gt;--- ODBC Error Detail ---&lt;BR /&gt;SQLState : 42P02&lt;BR /&gt;NativeError : 80&lt;BR /&gt;Message : [Databricks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNBOUND_SQL_PARAMETER] org.apache.spark.sql.catalyst.ExtendedAnalysisException: [UNBOUND_SQL_PARAMETER] Found the unbound parameter: _53. 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 1 pos 53&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:49)&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.$anonfun$execute$1(SparkExecuteStatementOperation.scala:1063)&lt;BR /&gt;at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)&lt;BR /&gt;at com.databricks.unity.UCSEphemeralState$Handle.runWith(UCSEphemeralState.scala:51)&lt;BR /&gt;at com.databricks.unity.HandleImpl.runWith(UCSHandle.scala:104)&lt;BR /&gt;at org.apache.spark.[Databricks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: [UNBOUND_SQL_PARAMETER] org.apache.spark.sql.catalyst.ExtendedAnalysisException: [UNBOUND_SQL_PARAMETER] Found the unbound parameter: _53. 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 1 pos 53&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:49)&lt;BR /&gt;at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.$anonfun$execute$1(SparkExecuteStatementOperation.scala:1063)&lt;BR /&gt;at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)&lt;BR /&gt;at com.databricks.unity.UCSEphemeralState$Handle.runWith(UCSEphemeralState.scala:51)&lt;BR /&gt;at com.databricks.unity.HandleImpl.runWith(UCSHandle.scala:104)&lt;BR /&gt;at org.apache.spark.&lt;BR /&gt;Source : Databricks ODBC Driver&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Mar 2026 13:44:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150492#M53434</guid>
      <dc:creator>DitchT</dc:creator>
      <dc:date>2026-03-10T13:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC Parameterization issue (Basic .NET)</title>
      <link>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150493#M53435</link>
      <description>&lt;P&gt;I should probably add that I've tried to downgrade to the last Simba driver and that doesn't support transactions which are kinda required in my scenario. Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 13:46:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150493#M53435</guid>
      <dc:creator>DitchT</dc:creator>
      <dc:date>2026-03-10T13:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC Parameterization issue (Basic .NET)</title>
      <link>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150512#M53447</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't come across this issue myself but according to some internal resources I think the following fix may work.&lt;/P&gt;
&lt;P&gt;This is a known issue introduced in ODBC driver version 2.8.0. The root cause is that the default for EnableNativeParameterizedQuery was changed from 1 to 0 in that release (to protect Power BI users). Without it, the driver's client-side SQL parser tries to rewrite parameterized queries but fails on DML statements like INSERT — it sends unresolved internal parameter names (_53, _67, etc.) to the server, which causes the UNBOUND_SQL_PARAMETER error. &lt;BR /&gt;&lt;BR /&gt;SELECT queries work because the driver's ANSI SQL-92 parser handles simple SELECT parameterization, but INSERT/DML and complex SQL (CTEs, CASE WHEN, etc.) are not reliably handled by the client-side parser. &lt;BR /&gt;&lt;BR /&gt;The fix is to add these two settings to your connection string: &lt;BR /&gt;&lt;BR /&gt;UseNativeQuery=1;EnableNativeParameterizedQuery=1;&lt;/P&gt;
&lt;P&gt;For C# OdbcConnection, these must be in the connection string itself, not just the DSN configuration. So your connection string should look something like:&lt;/P&gt;
&lt;P&gt;Driver={Databricks};Host=...;Port=443;HTTPPath=...;AuthMech=11;Auth_Flow=0;Auth_AccessToken=...;SSL=1;UseNativeQuery=1;EnableNativeParameterizedQuery=1;&lt;/P&gt;
&lt;P&gt;FastSQLPrepare is unrelated to this issue and won't help here.&lt;/P&gt;
&lt;P&gt;If you're on an older driver version, I'd also recommend updating to 2.9.1+ as there have been additional fixes for parameterized query handling.&lt;/P&gt;
&lt;P&gt;I haven't been able to test this so if it works please mark as accepted solution to help others.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 18:43:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150512#M53447</guid>
      <dc:creator>emma_s</dc:creator>
      <dc:date>2026-03-10T18:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC Parameterization issue (Basic .NET)</title>
      <link>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150516#M53450</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/176516"&gt;@emma_s&lt;/a&gt;&amp;nbsp;Thank you so much! This resolves the issue for me.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 19:37:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/odbc-parameterization-issue-basic-net/m-p/150516#M53450</guid>
      <dc:creator>DitchT</dc:creator>
      <dc:date>2026-03-10T19:37:18Z</dc:date>
    </item>
  </channel>
</rss>

