<?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: Databricks SQL format_string in LOCATION in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36941#M26227</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/26931"&gt;@pcbzmani&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Unfortunately that doesn't seem to work. The issue appears to be with the use of format_string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[PARSE_SYNTAX_ERROR] Syntax error at or near 'format_string'.line 2, pos 9

== SQL ==
CREATE DATABASE IF NOT EXISTS new_database
LOCATION format_string('abfss://container-name@%s.dfs.core.windows.net/', SELECT SECRET('secret-scope', 'storage-account-name'))
---------^^^&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 04 Jul 2023 13:59:01 GMT</pubDate>
    <dc:creator>kellybe</dc:creator>
    <dc:date>2023-07-04T13:59:01Z</dc:date>
    <item>
      <title>Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36905#M26211</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to assign a location to a new database in Databricks SQL. Normally I'd do this in Python since we specify storage account names from secret scopes, however I'm attempting to do all of this from a SQL warehouse. When doing this I seem to get a PARSE_SYNTAX_ERROR, when I'm not sure what's wrong with the query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE DATABASE IF NOT EXISTS new_database
LOCATION format_string('abfss://container-name@%s.dfs.core.windows.net/', SECRET('secret-scope', 'storage-account-name'));&lt;/LI-CODE&gt;&lt;P&gt;Has anyone seen similar errors to this one? It appears to have an issue with the use of format_string as a location.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[PARSE_SYNTAX_ERROR] Syntax error at or near 'format_string'.line 2, pos 9

== SQL ==
CREATE DATABASE IF NOT EXISTS new_database
LOCATION format_string('abfss://container-name@%s.dfs.core.windows.net/', SECRET('secret-scope', 'storage-account-name'))
---------^^^&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 08:30:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36905#M26211</guid>
      <dc:creator>kellybe</dc:creator>
      <dc:date>2023-07-04T08:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36906#M26212</link>
      <description>&lt;P&gt;Why you are using secrets there ??&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 08:38:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36906#M26212</guid>
      <dc:creator>Aviral-Bhardwaj</dc:creator>
      <dc:date>2023-07-04T08:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36908#M26214</link>
      <description>&lt;P&gt;We store environment variables as secrets to maintain consistency across our various environments.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 08:39:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36908#M26214</guid>
      <dc:creator>kellybe</dc:creator>
      <dc:date>2023-07-04T08:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36928#M26223</link>
      <description>&lt;P&gt;What does the below piece do?&lt;BR /&gt;SECRET('secret-scope', 'storage-account-name')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 11:53:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36928#M26223</guid>
      <dc:creator>VaibB</dc:creator>
      <dc:date>2023-07-04T11:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36930#M26224</link>
      <description>&lt;P&gt;The SECRET function takes a secret scope and a key and returns the specified secret as a string.&lt;/P&gt;&lt;P&gt;Here are the docs for it:&amp;nbsp;&lt;A href="https://docs.databricks.com/sql/language-manual/functions/secret.html" target="_blank"&gt;https://docs.databricks.com/sql/language-manual/functions/secret.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 12:00:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36930#M26224</guid>
      <dc:creator>kellybe</dc:creator>
      <dc:date>2023-07-04T12:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36940#M26226</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/84314"&gt;@kellybe&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE DATABASE IF NOT EXISTS new_database
LOCATION format_string('abfss://container-name@%s.dfs.core.windows.net/', select SECRET('secret-scope', 'storage-account-name'));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Add Select before secert&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 13:55:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36940#M26226</guid>
      <dc:creator>pcbzmani</dc:creator>
      <dc:date>2023-07-04T13:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks SQL format_string in LOCATION</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36941#M26227</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/26931"&gt;@pcbzmani&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Unfortunately that doesn't seem to work. The issue appears to be with the use of format_string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[PARSE_SYNTAX_ERROR] Syntax error at or near 'format_string'.line 2, pos 9

== SQL ==
CREATE DATABASE IF NOT EXISTS new_database
LOCATION format_string('abfss://container-name@%s.dfs.core.windows.net/', SELECT SECRET('secret-scope', 'storage-account-name'))
---------^^^&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 04 Jul 2023 13:59:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-sql-format-string-in-location/m-p/36941#M26227</guid>
      <dc:creator>kellybe</dc:creator>
      <dc:date>2023-07-04T13:59:01Z</dc:date>
    </item>
  </channel>
</rss>

