<?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: Current_Database() function unexpected results when queried with PowerBI in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/current-database-function-unexpected-results-when-queried-with/m-p/5351#M1793</link>
    <description>&lt;P&gt;Hya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;User has select and use on the schema, have tried execute the other day but it made no difference.&lt;/LI&gt;&lt;LI&gt;We can`t do this as the database filtered by the view has to be controlled by us as it`s part of a multi-tenanted setup.&lt;/LI&gt;&lt;LI&gt;Tried this.  Seems to work!&lt;/LI&gt;&lt;LI&gt;See above.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 07:52:16 GMT</pubDate>
    <dc:creator>DrK</dc:creator>
    <dc:date>2023-04-25T07:52:16Z</dc:date>
    <item>
      <title>Current_Database() function unexpected results when queried with PowerBI</title>
      <link>https://community.databricks.com/t5/data-engineering/current-database-function-unexpected-results-when-queried-with/m-p/5349#M1791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I`m creating some views to be queried by PowerBI.  In our delta tables we have a column called database name which contains the source systems database name.  What I`m doing is using this to filter data WHERE databaseName = current_database().  Now I`ve had to replace the `s that come through this value and all works ok when queried within a worksheet, i.e. if I change database\schema context, my rows get filtered.  However, if I query the same view from PowerBI, I got no data at all.  I`ve tested the view using a hardcoded database name i.e. WHERE databaseName = 'the database name' and that works fine.  The ony thing I could think it could be is priviledges, as the PAT token created for access by PowerBI only has SELECT priviledges on the database, wondering if it can`t use the Current_Database() function or similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drk.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 10:57:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/current-database-function-unexpected-results-when-queried-with/m-p/5349#M1791</guid>
      <dc:creator>DrK</dc:creator>
      <dc:date>2023-04-24T10:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Current_Database() function unexpected results when queried with PowerBI</title>
      <link>https://community.databricks.com/t5/data-engineering/current-database-function-unexpected-results-when-queried-with/m-p/5351#M1793</link>
      <description>&lt;P&gt;Hya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;User has select and use on the schema, have tried execute the other day but it made no difference.&lt;/LI&gt;&lt;LI&gt;We can`t do this as the database filtered by the view has to be controlled by us as it`s part of a multi-tenanted setup.&lt;/LI&gt;&lt;LI&gt;Tried this.  Seems to work!&lt;/LI&gt;&lt;LI&gt;See above.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 07:52:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/current-database-function-unexpected-results-when-queried-with/m-p/5351#M1793</guid>
      <dc:creator>DrK</dc:creator>
      <dc:date>2023-04-25T07:52:16Z</dc:date>
    </item>
  </channel>
</rss>

