开发者

How to put a parameter into an query in SSRS 2008 R2 connected to an Oracle Database 11g

Putting a parameter into the query gets the following error:

"ORA-01036: illegal variable name/number"

The query is:

select * from t_accounts where account_number = @ReportParamter1

Without the where clause, the query runs fine

Any ideas?

开发者_运维知识库

thanx!

Abraham


Oracle wants its bound parameters to be denoted with colons, not @ signs. So you want

...where account_number = :ReportParamter1


O. Jones highlighted the root but didn't go into as much detail as I needed to address this same issue/question. I had created the parameter in Visual Studio and as noted it has the '@' in the format of the parameter so when applied to the Dataset I got the error message. Unfortunately in the construct of the parameter in VS (I'm using 12) there isn't anything in the various options that allows designating a : in place of the @. What I discovered was after manually adding the parameter to my query in the Dataset, I then found it listed in the parameters area of the Dataset Properties - the parameter entered in query was set to the parameter made in VS. I removed the original and preview processed without issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜