Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
dramnath_1981
Frequent Visitor

SQL query using tables from Query Editor

Hi,

 

I have one table from the Oracle database and the other one from the SQL database. Since these are 2 different databases, in "GET DATA" I need to choose 2 different connections like MYSQL & ODBC. I did that and got both the tables in Query editor as 2 separate tables as shown below.

 

dramnath_1981_0-1615402816308.png

Now I need to run an SQL code that should take these 2 tables as a reference and give me an output. Doing this in Power BI with so many joins, merges, and custom columns will slow down the auto-refresh. Hence looking out for a solution.

 

I am not sure, whether it is possible to reference 2 tables within 1 Power BI file and use them as a reference to write an SQL query and get desired output. Kindly help with your valued opinion on the possibility.

 

Regards, Ramnath

1 REPLY 1
DataInsights
Super User
Super User

Hi @dramnath_1981,

 

You may want to create a linked server (see article below). An example is creating a linked server in a SQL Server database that points to an Oracle database. Then you can write SQL that will query tables in each database. You can use the OPENQUERY function in SQL Server to send PL/SQL to an Oracle database.

 

https://docs.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-eng... 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.