<?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: Help with Parameters in Databricks SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5976#M2233</link>
    <description>&lt;P&gt;Hello @Anne Walter​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you calling this from the sql query editor or a workflow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Nandini&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 07:29:59 GMT</pubDate>
    <dc:creator>NandiniN</dc:creator>
    <dc:date>2023-04-14T07:29:59Z</dc:date>
    <item>
      <title>Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5973#M2230</link>
      <description>&lt;P&gt;I am following the documentation on query parameters (https://docs.databricks.com/sql/user/queries/query-parameters.html) and it's not working for me. I can't get a parameter inserted at the text caret and I can't get cmd + p to work. I've changed spacing around the curly braces, I've added and removed single quotations. I've tried iterations of ctrl + shift + p, ctrl + tab + p, ctrl + alt + p, etc to get the parameter dialogue to pop up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my text as it stands now:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select EOWinventory, Monday_Date
from snapshot.weekly_inventory_status
where Monday_Date = '{{projection_date}}'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone have best practices? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 15:04:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5973#M2230</guid>
      <dc:creator>AEW</dc:creator>
      <dc:date>2023-04-12T15:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5974#M2231</link>
      <description>&lt;P&gt;I think you can try this.&lt;/P&gt;&lt;P&gt;Please try adding a space between the Curly brackets "{ { param_name } } "&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 07:04:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5974#M2231</guid>
      <dc:creator>DD_Sharma</dc:creator>
      <dc:date>2023-04-14T07:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5975#M2232</link>
      <description>&lt;OL&gt;&lt;LI&gt;select EOWinventory &lt;/LI&gt;&lt;LI&gt;from snapshot.weekly_inventory_status&lt;/LI&gt;&lt;LI&gt;where Monday_Date = '{{projection_date}}' group by Monday_Date&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Can you try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 07:04:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5975#M2232</guid>
      <dc:creator>User16756723392</dc:creator>
      <dc:date>2023-04-14T07:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5976#M2233</link>
      <description>&lt;P&gt;Hello @Anne Walter​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you calling this from the sql query editor or a workflow?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Nandini&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 07:29:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5976#M2233</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2023-04-14T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5977#M2234</link>
      <description>&lt;P&gt;You do have to put a space between the brackets on either side of the parameter and it should work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{{ schema_name }}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM {{ schema_table_name }}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Databricks requires that you wrap date and time values in single quotes (')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;SELECT&lt;/B&gt; *&lt;/P&gt;&lt;P&gt;&lt;B&gt;FROM&lt;/B&gt; usage_logs&lt;/P&gt;&lt;P&gt;&lt;B&gt;WHERE&lt;/B&gt; date = '{{ date_param }}'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 07:40:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5977#M2234</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2023-04-14T07:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5978#M2235</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.databricks.com/s/profile/0058Y00000C0IFSQA3" alt="https://community.databricks.com/s/profile/0058Y00000C0IFSQA3" target="_blank"&gt;@User16756723392331126896&lt;/A&gt;&amp;nbsp;(Customer)​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this out, I was able to get the text query parameter by default which I changed to date by clicking on the gear button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are a few things -&lt;/P&gt;&lt;P&gt;In mac I typed Control + P (not Command + P)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Param"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/376iBAA542FDB6EFEF68/image-size/large?v=v2&amp;amp;px=999" role="button" title="Param" alt="Param" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I tried your query, it actually still did not give me a date parameter, but it was text, I clicked on the gear button and changed it to date from drop down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="date"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/372i133332A30C3CA3A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="date" alt="date" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using double quotes seems to have solved it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="correct"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/364iE98A755D0F794314/image-size/large?v=v2&amp;amp;px=999" role="button" title="correct" alt="correct" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know the document needs update and I will get that going but I hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case it does, please select it as the answer that resolved your issue and let me know if you still face any issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp;. Regards,&lt;/P&gt;&lt;P&gt;Nandini&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 10:54:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5978#M2235</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2023-04-14T10:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5979#M2236</link>
      <description>&lt;P&gt;I don't see the need for spaces around the parameter name...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/377i6A1F5B68BD7BE7B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just been typing {{param_name}} and it appears automatically in SQL editor&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 11:09:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5979#M2236</guid>
      <dc:creator>labromb</dc:creator>
      <dc:date>2023-04-14T11:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5980#M2237</link>
      <description>&lt;P&gt;Correct, that was an older workaround, which is now fixed in the later versions, sorry about that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Brian Labrom​&amp;nbsp;if my answer helps, it would be great if you could upvote it or mark is at Best answer to close the loop.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 17:13:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5980#M2237</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2023-04-14T17:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Parameters in Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5981#M2238</link>
      <description>&lt;P&gt;This was the issue! I wasn't calling it from the sql editor. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 16:02:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-with-parameters-in-databricks-sql/m-p/5981#M2238</guid>
      <dc:creator>AEW</dc:creator>
      <dc:date>2023-04-18T16:02:28Z</dc:date>
    </item>
  </channel>
</rss>

