Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Query works in Oracle SQL, but PowerBI returns nothing

My query works as expected in Oracle SQL Developer. When I use the same query to connect to the Oracle data source in PowerBI, it does the usual loading steps, but there is no data returned, only col...
  • Ghhousuddin's avatar
    3 years ago

    There are a few possible reasons why your query is not returning any data in Power BI, even though it works in Oracle SQL Developer. Here are some suggestions to troubleshoot the issue:

    1. Check if your query contains any date-related or Oracle-specific functions that might not be supported or might behave differently in Power BI. For example, FROM_TZ, CAST, and DBMS_LOB.SUBSTR are Oracle-specific functions. Try to replace these functions with Power Query transformations after importing the data.

    2. Instead of using LIKE for date comparisons, use proper date comparisons. For example, change:

    3. AND A.TMSTMP LIKE ('%2023%')
      AND (C.CREATE_DATE LIKE ('%2022%') OR C.CREATE_DATE LIKE ('%2023%'))
    4. to:
    5. AND EXTRACT(YEAR FROM A.TMSTMP) = 2023
      AND (EXTRACT(YEAR FROM C.CREATE_DATE) = 2022 OR EXTRACT(YEAR FROM C.CREATE_DATE) = 2023)
      1. Remove comments from the query or move them to a separate line. In some cases, comments can cause issues when importing queries into Power BI.

      2. Try importing data in multiple steps by simplifying the query. For example, import the data from the "redacted" table first, and then apply the JOIN and filter conditions using Power Query transformations in Power BI.

      3. Verify the connection settings and credentials in Power BI. Make sure you are using the correct connection settings, and your user account has the necessary privileges to access the data.

      4. Ensure that the data types of the columns in your query match the data types in Power BI. Power BI might not recognize some data types or might convert them differently than Oracle SQL Developer.

      If none of these suggestions resolve the issue, consider breaking down the query into smaller parts to identify which part of the query is causing the problem. Then, modify the problematic part accordingly or use Power Query transformations in Power BI to achieve the same result.