<?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 Is there a way to run Databricks query on vba? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9130#M4609</link>
    <description>&lt;P&gt;Currently, I just manually copy paste ​a code from an excel sheet and paste it on a databricks notebook and run for results, then, copy paste the results to the same workbook. I'm sure there's a faster way to do it. The only solutions i can find is using the query wizard but the issue is that the data is so large and the query changes everytime too. I've already connected the databricks database to my workbook &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I can easily run sql on vba with ADO connection and paste the result but I have no clue how to do it for databricks.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I'm still fairly new to databrick so I welcome any advice coming my way. Thanks!​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2023 17:12:30 GMT</pubDate>
    <dc:creator>HDW_14</dc:creator>
    <dc:date>2023-02-17T17:12:30Z</dc:date>
    <item>
      <title>Is there a way to run Databricks query on vba?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9130#M4609</link>
      <description>&lt;P&gt;Currently, I just manually copy paste ​a code from an excel sheet and paste it on a databricks notebook and run for results, then, copy paste the results to the same workbook. I'm sure there's a faster way to do it. The only solutions i can find is using the query wizard but the issue is that the data is so large and the query changes everytime too. I've already connected the databricks database to my workbook &lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I can easily run sql on vba with ADO connection and paste the result but I have no clue how to do it for databricks.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I'm still fairly new to databrick so I welcome any advice coming my way. Thanks!​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 17:12:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9130#M4609</guid>
      <dc:creator>HDW_14</dc:creator>
      <dc:date>2023-02-17T17:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to run Databricks query on vba?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9131#M4610</link>
      <description>&lt;P&gt;@Hanna Wade​&amp;nbsp;: Yes, it is possible to run Databricks queries from VBA by using the Databricks REST API. To run a Databricks query from VBA, you would need to use VBA's HTTP request library to send a POST request to the Databricks REST API endpoint that executes the query. You would also need to authenticate with Databricks using an access token or personal access token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Sub RunDatabricksQuery()
&amp;nbsp;
    Dim apiUrl As String
    Dim accessToken As String
    Dim requestBody As String
    Dim http As New XMLHTTP60
    Dim responseText As String
    
    ' Set the Databricks API URL and access token
    apiUrl = "https://&amp;lt;databricks-instance&amp;gt;/api/2.0/sql/endpoints/&amp;lt;endpoint-id&amp;gt;/query"
    accessToken = "&amp;lt;access-token&amp;gt;"
    
    ' Set the query to be executed
    requestBody = "{""query"":""SELECT * FROM my_table""}"
    
    ' Send the POST request to execute the query
    http.Open "POST", apiUrl, False
    http.setRequestHeader "Authorization", "Bearer " &amp;amp; accessToken
    http.setRequestHeader "Content-Type", "application/json"
    http.send requestBody
    
    ' Retrieve the query results
    responseText = http.responseText
    
    ' Do something with the query results
    Debug.Print responseText
    
End Sub&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please refer the link: &lt;A href="https://docs.databricks.com/dev-tools/api/index.html" alt="https://docs.databricks.com/dev-tools/api/index.html" target="_blank"&gt;https://docs.databricks.com/dev-tools/api/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 01:07:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9131#M4610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-08T01:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to run Databricks query on vba?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9132#M4611</link>
      <description>&lt;P&gt;Hi @Hanna Wade​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 03:27:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-run-databricks-query-on-vba/m-p/9132#M4611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-11T03:27:21Z</dc:date>
    </item>
  </channel>
</rss>

