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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
boeschr
Frequent Visitor

ORA-00900: Error with opening a session in a SQL statement for Oracle database

Hi all

 

Maybe someone can help me. 

We have a case where we want to access data from an Oracle DB where we have to open a session before we can execute our query. While this works in other tools, Power BI seems to have a problem (see screenshot)

 

boeschr_0-1687788010566.jpeg

 

Our first idea was to create a new query with just the part to open the session and a second one to get the data from the db. This only worked from time to time, when the query to open the session was executed before the second one. Unfortunately, we where not able to solve this problem.

 

Then we tried to create functions and call them in the right sequence order (see code below). But this dind't work as well.

 

let
    openSession = () => Oracle.Database("XYZ", [HierarchicalNavigation=true, Query="begin e.env_session_intf#.open_session; end;"]),
    Source = ()  => Oracle.Database("Database", [HierarchicalNavigation=true, Query= "select * from XYZ"]),
    Load = Function.InvokeAfter(openSession, #duration(0,0,0,1)),
    Delay = Function.InvokeAfter(Source, #duration(0,0,0,59)),
    #"Renamed Columns" = Table.RenameColumns(Delay,{{"NAME", "Name"}, {"COMPONENT", "Component"}, {"RELEASE", "Release"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Name", type text}, {"Component", type text}, {"Release", type text}, {"Change ID", type text}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Changed Type",{"Name",  "Component", "Release", "Change ID", "ID"})
in
    #"Reordered Columns"

 

 

Any suggestions how this could work? Maybe someone already has experience with this problem.

 

Thanks a lot!

 

2 REPLIES 2
Anonymous
Not applicable

Hi @boeschr ,

 

The error message "ORA-00900" indicates that there is a syntax error in the SQL statement. One possible cause of this error is that the Oracle client either isn't installed or isn't configured properly. If it's installed, verify that the tnsnames.ora file is properly configured and you're using the proper net_service_name. You also need to make sure that the net_service_name is the same between the machine that uses Power BI Desktop and the machine that runs the gateway. It is advised that for Oracle configuration errors, the customer should work with their oracle support to understand and configure correctly.

 

   

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Thanks for the advice, I will check it.

Spoiler
Thanks for the advice, I will check it. If you're in need of thesis writing help and came across the website https://studyclerk.com/thesis-writing-help while searching on Google, it's essential to read evaluations and reviews before using their services. Reviews can offer valuable insights into the website's credibility, reliability, and quality of its writing assistance.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.