<?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: bug with using parameters in a sql task in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119652#M45940</link>
    <description>&lt;P&gt;Here is another reason I believe this is bugged. I'm looking &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/user/queries/query-parameters" target="_self"&gt;at the documentation&lt;/A&gt; on how to format sql using parameters and I see almost this exact example for formatting the catalog. It gives two options, you can format with curly braces or with the IDENTIFIER function. I've gotten the IDENTIFIER function to work for us, but the curly brace version is adding extra quotation marks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kenmyers8451_0-1747679364541.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16946i9D68D71B0FBA8521/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kenmyers8451_0-1747679364541.png" alt="kenmyers8451_0-1747679364541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 19 May 2025 18:35:35 GMT</pubDate>
    <dc:creator>kenmyers-8451</dc:creator>
    <dc:date>2025-05-19T18:35:35Z</dc:date>
    <item>
      <title>bug with using parameters in a sql task</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119647#M45937</link>
      <description>&lt;P&gt;I am trying to make a sql task that runs using a serverless sql warehouse that takes a variable and uses that in the sql file that it is running in a serverless warehouse, however I am getting errors because databricks keeps formatting it first with quotation marks. For example let's say the file I'm trying to run just has USE CATALOG my_catalog_{{env}} and my task has an env parameter with the value dev. This sql ends up getting formatted as&amp;nbsp;USE CATALOG my_catalog_'dev' which clearly isn't valid sql. This seems like a bug, I don't think databricks should be adding quotes to these values because there are many cases where a user would want to format something without quotes around it. I can provide a workflow sample if this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kenmyers8451_0-1747677585574.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16945i6A669C299AA014C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kenmyers8451_0-1747677585574.png" alt="kenmyers8451_0-1747677585574.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 18:00:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119647#M45937</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2025-05-19T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: bug with using parameters in a sql task</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119652#M45940</link>
      <description>&lt;P&gt;Here is another reason I believe this is bugged. I'm looking &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/user/queries/query-parameters" target="_self"&gt;at the documentation&lt;/A&gt; on how to format sql using parameters and I see almost this exact example for formatting the catalog. It gives two options, you can format with curly braces or with the IDENTIFIER function. I've gotten the IDENTIFIER function to work for us, but the curly brace version is adding extra quotation marks.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kenmyers8451_0-1747679364541.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16946i9D68D71B0FBA8521/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kenmyers8451_0-1747679364541.png" alt="kenmyers8451_0-1747679364541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 18:35:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119652#M45940</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2025-05-19T18:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: bug with using parameters in a sql task</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119719#M45958</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/147746"&gt;@kenmyers-8451&lt;/a&gt;, when you use the curly bracket syntax like {{env}}, it treats the value as a string and automatically adds quotes, that’s why you’re seeing something like my_catalog_'dev'. If you’re trying to use dynamic SQL object names, it’s better to avoid the curly brackets and instead use the colon syntax with IDENTIFIER() to reference the parameter correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 10:42:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119719#M45958</guid>
      <dc:creator>Renu_</dc:creator>
      <dc:date>2025-05-20T10:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: bug with using parameters in a sql task</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119774#M45968</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/151751"&gt;@Renu_&lt;/a&gt;&amp;nbsp;consider this example&lt;/P&gt;&lt;P&gt;ALTER TABLE some.table SET OWNER TO IDENTIFIER('`' || :owner_name || '`')&lt;/P&gt;&lt;P&gt;You can't use IDENTIFIER here, it throws an error (&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/sql-ref-names-identifier-clause" target="_self"&gt;it is not a supported use case&lt;/A&gt;). If you try to do&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALTER TABLE some.table SET OWNER TO `{{owner_name}}`&lt;/P&gt;&lt;P&gt;this gets formatted to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;ALTER TABLE some.table SET OWNER TO `'my_owners_name'`&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which errors because those quotes it adds are invalid here. There is NO way to format this sql with a task parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 14:30:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/119774#M45968</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2025-05-20T14:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: bug with using parameters in a sql task</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/134402#M50123</link>
      <description>&lt;P&gt;I have been trying to use templates as well and got the following string:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;LOCATION&lt;/SPAN&gt; &lt;SPAN class=""&gt;'s3://s3-company-data-'&lt;/SPAN&gt;&lt;SPAN&gt; dev &lt;/SPAN&gt;&lt;SPAN class=""&gt;'-'&lt;/SPAN&gt; &lt;SPAN class=""&gt;1122334455&lt;/SPAN&gt; &lt;SPAN class=""&gt;'-eu-central-1/path_to_churn/main/'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Oct 2025 13:49:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-with-using-parameters-in-a-sql-task/m-p/134402#M50123</guid>
      <dc:creator>asuvorkin</dc:creator>
      <dc:date>2025-10-09T13:49:45Z</dc:date>
    </item>
  </channel>
</rss>

