<?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: [UNBOUND_SQL_PARAMETER] When running Placeholder query in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59637#M2517</link>
    <description>&lt;LI-CODE lang="markup"&gt;# Query parameters

Passing parameters to a query is supported when run against servers with version DBR 14.1.

	p := dbsql.Parameter{Name: "p_bool", Value: true},
	rows, err1 := db.QueryContext(ctx, `select * from sometable where condition=:p_bool`,dbsql.Parameter{Name: "p_bool", Value: true})&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://github.com/databricks/databricks-sql-go/blob/main/doc.go#L187" target="_blank" rel="noopener"&gt;databricks-sql-go/doc.go at main · databricks/databricks-sql-go (github.com)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2024 03:41:00 GMT</pubDate>
    <dc:creator>feiyun0112</dc:creator>
    <dc:date>2024-02-08T03:41:00Z</dc:date>
    <item>
      <title>[UNBOUND_SQL_PARAMETER] When running Placeholder query</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59622#M2516</link>
      <description>&lt;P&gt;I am using the databricks-sql-go library version 1.5.2. I am trying to run a query with placeholders of type '?'&lt;/P&gt;&lt;P&gt;The query looks like&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;params&lt;SPAN&gt;, &lt;/SPAN&gt;args := &lt;SPAN&gt;databricksParams&lt;/SPAN&gt;(values)&lt;BR /&gt;sql := &lt;SPAN&gt;fmt&lt;/SPAN&gt;.&lt;SPAN&gt;Sprintf&lt;/SPAN&gt;(&lt;SPAN&gt;`&lt;/SPAN&gt;&lt;SPAN&gt;SELECT COUNT(*) FROM %s.%s WHERE %s IN (%s)&lt;/SPAN&gt;&lt;SPAN&gt;`&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;schema&lt;SPAN&gt;, &lt;/SPAN&gt;table&lt;SPAN&gt;, &lt;/SPAN&gt;column&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;strings&lt;/SPAN&gt;.&lt;SPAN&gt;Join&lt;/SPAN&gt;(params&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;", "&lt;/SPAN&gt;))&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;res&lt;SPAN&gt;, &lt;/SPAN&gt;err := conn.&lt;SPAN&gt;Exec&lt;/SPAN&gt;(sql&lt;SPAN&gt;, &lt;/SPAN&gt;args...)&lt;/DIV&gt;&lt;DIV&gt;where params is nothing but a slice of '?' and args are the values I want to query.&lt;/DIV&gt;&lt;DIV&gt;I am getting the error&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[UNBOUND_SQL_PARAMETER] Found the unbound parameter: _58. Please, fix `args` and provide a mapping of the parameter to a SQL literal.; line 1 pos 58&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have tried with $1,$2 type placeholders as well. Is this not supported with Databricks or am I doing something incorrectly.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Feb 2024 21:07:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59622#M2516</guid>
      <dc:creator>AadityaBhatt</dc:creator>
      <dc:date>2024-02-07T21:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: [UNBOUND_SQL_PARAMETER] When running Placeholder query</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59637#M2517</link>
      <description>&lt;LI-CODE lang="markup"&gt;# Query parameters

Passing parameters to a query is supported when run against servers with version DBR 14.1.

	p := dbsql.Parameter{Name: "p_bool", Value: true},
	rows, err1 := db.QueryContext(ctx, `select * from sometable where condition=:p_bool`,dbsql.Parameter{Name: "p_bool", Value: true})&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://github.com/databricks/databricks-sql-go/blob/main/doc.go#L187" target="_blank" rel="noopener"&gt;databricks-sql-go/doc.go at main · databricks/databricks-sql-go (github.com)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 03:41:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59637#M2517</guid>
      <dc:creator>feiyun0112</dc:creator>
      <dc:date>2024-02-08T03:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: [UNBOUND_SQL_PARAMETER] When running Placeholder query</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59658#M2519</link>
      <description>&lt;P&gt;This works fine when I have to pass just 1 argument. But how will this work where I have n number of values to pass inside an IN clause?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 08:38:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59658#M2519</guid>
      <dc:creator>AadityaBhatt</dc:creator>
      <dc:date>2024-02-08T08:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: [UNBOUND_SQL_PARAMETER] When running Placeholder query</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59724#M2522</link>
      <description>&lt;P&gt;Can you print out an example after the Sprintf substitutions?&lt;BR /&gt;It seems you generated a query with a named parameter: ":_58" But args (which should be a Map) does not have a key named "_58".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 21:58:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unbound-sql-parameter-when-running-placeholder-query/m-p/59724#M2522</guid>
      <dc:creator>SergeRielau</dc:creator>
      <dc:date>2024-02-08T21:58:35Z</dc:date>
    </item>
  </channel>
</rss>

