$P{parameterName} in sql statement (fetch first N rows only)

If I try to include a parameter in my sql statement 

select * from table where (...) group by (...) fetch first $P{param} rows only

I get the error "mismatched input '$P{param}' expecting RULE_INT"

$P{param} should evaluate to an integer, as set by the user.

How could this error be avoided ? 

Thanks !

 

grl's picture
grl
155
Joined: Jul 28 2014 - 11:17am
Last seen: 8 years 3 weeks ago

4 Answers:

Use $P!{param}.

 

The exclam makes the value an unquoted string.

sfriedman's picture
207
Joined: Oct 22 2008 - 3:26am
Last seen: 7 years 11 months ago
Thank you so much for your answer, but I am still getting the same error ....
grl's picture
grl
155
Joined: Jul 28 2014 - 11:17am
Last seen: 8 years 3 weeks ago

anyone has any other suggestion on this issue ? Thanks !

grl's picture
grl
155
Joined: Jul 28 2014 - 11:17am
Last seen: 8 years 3 weeks ago

Hello,

Did you find how to get it work ? I have the exact same issue.

Thanks

Charlotte

chboutteau's picture
Joined: May 18 2016 - 8:28am
Last seen: 6 years 3 months ago
Feedback