<?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 Not able to escape `-` in external connected tablename in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/54081#M1084</link>
    <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We are having some issues with getting data from some tables with the character `-` in their tablename.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We are connected to the database with an SQL server connection, and the database is (as far as we know)&amp;nbsp; a Microsoft Azure SQL Database. We do not have access to the database other than credentials to read a specific schema.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;When we either try to view sample data in Unity Catalog, or run a query like: &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;"SELECT * FROM `&lt;SPAN&gt;tablename$i-comm`;"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;We get the error: &lt;SPAN&gt;Incorrect syntax near '-'.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We have tried to escape special characters in the table name in various ways without luck.&lt;/FONT&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i-comm` &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`[tablename$i-comm]`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;"tablename$i-comm"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i/-comm`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i\-comm`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;etc&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have any idea of how we can read data from a table with a name like that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 28 Nov 2023 09:32:23 GMT</pubDate>
    <dc:creator>acurus</dc:creator>
    <dc:date>2023-11-28T09:32:23Z</dc:date>
    <item>
      <title>Not able to escape `-` in external connected tablename</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/54081#M1084</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We are having some issues with getting data from some tables with the character `-` in their tablename.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We are connected to the database with an SQL server connection, and the database is (as far as we know)&amp;nbsp; a Microsoft Azure SQL Database. We do not have access to the database other than credentials to read a specific schema.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;When we either try to view sample data in Unity Catalog, or run a query like: &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;"SELECT * FROM `&lt;SPAN&gt;tablename$i-comm`;"&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;We get the error: &lt;SPAN&gt;Incorrect syntax near '-'.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;We have tried to escape special characters in the table name in various ways without luck.&lt;/FONT&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i-comm` &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`[tablename$i-comm]`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;"tablename$i-comm"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i/-comm`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;`tablename$i\-comm`&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;etc&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Does anyone have any idea of how we can read data from a table with a name like that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Nov 2023 09:32:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/54081#M1084</guid>
      <dc:creator>acurus</dc:creator>
      <dc:date>2023-11-28T09:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to escape `-` in external connected tablename</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/54157#M1086</link>
      <description>&lt;P&gt;Hi Kaniz and thank you for the thourogh answer!&lt;/P&gt;&lt;P&gt;As I mentioned in my post I have tried square brackes around the table name without luck. As also noted, it's not an Oracle database, and I have tried double quotes around the table name without luck.&lt;/P&gt;&lt;P&gt;I did not try the "ESCAPE" keyword as that is only for "LIKE" queries as far as I know. I did give it a go now, and was not able to get it to work.&lt;/P&gt;&lt;P&gt;I fully agree that using special characters in table names is bad practice, unfortunally, as mentioned in the post, I do not have control over the tables, and can not change their names.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 06:41:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/54157#M1086</guid>
      <dc:creator>acurus</dc:creator>
      <dc:date>2023-11-29T06:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to escape `-` in external connected tablename</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/72749#M1385</link>
      <description>&lt;P&gt;Had the same issue when querying a table with the - character in the table name.&amp;nbsp;Got the error&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Incorrect syntax near '-'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Got the error on Databricks runtime version: 13.2 (includes Apache Spark 3.4.0, Scala 2.12)&lt;/P&gt;&lt;P&gt;No error when using&amp;nbsp;Databricks runtime version: 14.2 (includes Apache Spark 3.5.0, Scala 2.12)&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 07:53:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/not-able-to-escape-in-external-connected-tablename/m-p/72749#M1385</guid>
      <dc:creator>martinschou</dc:creator>
      <dc:date>2024-06-12T07:53:31Z</dc:date>
    </item>
  </channel>
</rss>

