Jump to content

Using parameters in SQL query. Jaspersort Studio 5.5


jvmolto

Recommended Posts

Hi,

with iReport I use the following query without error, but with Jaspersort Studio I get the errors marked in red

SELECT $P!{parTabla}.*,almdes      (==> mismatched input '.' expecting 'FROM')
FROM  $P!{parTabla}, alm
WHERE almcod=almlalm AND $P!{parWhere}
ORDER BY $P!{sqlOrden}               (==>  no viable alternative at input $P!{sqlOrden})

How to do this with jaspersoft studio?

Thanks in advance

 
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

There has been a change in the syntax. 

$P{parametername} is the old format and will not correct with null values. (Also, the ! in your SQL query shouldn't be there.)

It is best to use the new format: $X{EQUAL,fieldname,parametername}

Regards,
Ilona

Link to comment
Share on other sites

  • 5 months later...

Hi ilona,

I just wanted to ask you about the changes in the new format, regarding the dynamic queries, with this I mean that

 

Earlier for the queries to be dynamic what we did that is that we could store the whole SQL in a format of String as the default expression of the parameter, and then used that parameter in the query as $P!{parameter}

 

Please throw some light on the change in the new version.

 

Any Help is appreciated.

 

Thanks

Ankur Gupta

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...