Categories: SSIS

SSIS and the “ORA-00907: missing right parenthesis” error

I had the extreme pleasure recently to extract some data out of an Oracle database. I wrote the source query in Toad, where it executed successfully. I created my SSIS package, added the dataflow and an OLE DB Source component. I copy pasted the query into the editor and tested it using the preview. Which failed. Always a good start. The error message was useful, as always:

However, if I went to the columns tab of the source editor, all columns (and their metadata) were there. Hmmm, so SSIS could at least parse the query. Which, again, works just fine when executed directly on the Oracle database. When running the SSIS package, the error message changed to the following:

Source: “OraOLEDB” Hresult: 0x80040E14 Description: “ORA-00907: missing right parenthesis”.

Plot twist: there’s nothing wrong with the parenthesizes in the query. At this point I was ready to set my laptop on fire, but instead I decided to soldier on. After searching online and trying out some theories, it turns out a comment in the WHERE clause was the culprit. Something like this:

... 
WHERE 1 = 1
--AND mydatecolumn = '01jan2021'
...

For whatever reason, SSIS has issues parsing this. The explanation is that SSIS probably puts everything on one line, thus effectively commenting out the rest of the query. I removed the comment and lo and behold, the dataflow ran without issues. Another solution would be to use block comments using /* */ instead of line comments.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

Recent Posts

T-SQL Tuesday #199: Back to the on-prem

It's the second tuesday of the month, which means T-SQL Tuesday time! This month's topic…

2 days ago

T-SQL Tuesday #199 Invitation: Back to on-prem?

It's time for T-SQL Tuesday again! And we're almost to number 200! T-SQL Tuesday is…

1 week ago

Error Deploying GraphQL in Fabric: dm_exec_describe_first_result_set

A while ago we suddenly had an error while trying to deploy one Fabric workspace…

1 week ago

Session Materials for Techorama & DataGrillen 2026

I've uploaded the slides for my Techorama session Microsoft Fabric for Dummies and my DataGrillen…

3 weeks ago

Free Webinar about Columnstore Indexes

I'm doing a small series on indexing basics for SQL Server, and on May 14th…

1 month ago

Fabric Mirroring doesn’t start copying Rows

A short blog post about an issue with Fabric Mirroring (with Azure SQL DB as…

2 months ago