0
votes

I'm using Visual Studio 2010 SSRS. I have an Oracle select query that works when written just as a query in the dataset of my report, but I need it to work as an expression so I can take a dynamic filter condition.

The expression ends up looking like this, I cannot post the query as it may contain confidential information for the company I work for.

= "

[Query]

where "

+FORMAT(replace(Parameters!where.Value,":00.000",":00")) + "

[Order By Clause] "

Attempting to generate a preview of this report gives the following error:

An error occurred during local report processing. An error has occurred during report processing. Query execution failed for dataset 'ds_Main'. ORA-00923: FROM keyword not found where expected

If anyone can assist with this issue it would be very much appreciated.

1
As usual, it is difficult to debug query you can't see. I have no idea what is wrong, but - error says that your query looks like select ename emp or select ename where deptno = 10 or select replace('05.11.2019 20:00:00.000', ':00.000', ':00') dual or who knows what. Basically, from isn't found where Oracle expected it to be. You'll have to debug it a little bit.Littlefoot
For what it's worth, you probably don't need to resort to dynamic SQL in the first place, they are very difficult to maintain. You can reference parameters like: WHERE MY_COL = :MyParam. If you are using dates, you may need to wrap a TO_DATE function around it. Anything beyond that is probably over complicating it.StevenWhite

1 Answers

0
votes

Solved. Each line in the expression query requires a space at the end to prevent combination of words.