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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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