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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Need help with using custom query to bring in data from Oracle Database

I am running this SQL query to bring in data from our Oracle Server, but I keep getting an error and I am not exactly sure why. The query runs fine in Toad.

SELECT v.*, COALESCE(e.INCIDENT_COUNT, 0) AS VENDOR_INCIDENT_COUNT
FROM ISAFETY_DBA.SAFETY_OPS_VENDORS v
LEFT JOIN (
SELECT VENDOR_NAME, COUNT(*) AS INCIDENT_COUNT
FROM ISAFETY_DBA.SAFETY_EVENT_HDR_VW
GROUP BY VENDOR_NAME
) e ON v.VENDOR_NAME = e.VENDOR_NAME;

I get error: Oracle: ORA-00933: SQL command not properly ended

Any help would be appreciated!

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

This error typically occurs because you have a misspelling in your SQL statement, unsupported syntax or clauses, or the string terminates prematurely, causing the rest of the string to be interpreted as a markup.

Please ensure there's no semicolon (;) at the end of your query when running it in the problematic environment. Some SQL execution environments or connectors might not expect a semicolon.
And you can try running a simplified version of your query to isolate the issue. Start with a basic SELECT statement from one table and gradually add complexity (e.g., joins, subqueries) until the error reappears.
I've found some links for you that may be useful, so you can try reading through them to see if you can find a solution:
ORA-00933 - Database Error Messages (oracle.com)
oracle - SQL Error: ORA-00933: SQL command not properly ended - Stack Overflow
www.howtosop.com

Also ,sometimes the issue might not be with the query itself but with how the connection is configured or the permissions set up for the user executing the query. Ensure that the user has the necessary permissions to execute the types of commands in your query and that the connection to the Oracle server is correctly configured.

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors