Jump to content
Changes to the Jaspersoft community edition download ×

Error in SQL Query with Parameters in clause FROM


Ahulane

Recommended Posts

Hi,

 

I have a problem.

 

I want to pass a Parameter in clause FROM. But there is a probleme during the execution.

 

... FROM $P{PARAM_1} ...

 

My parameter is type of String (exemple value : param), so when i execute the program, it make automatically quotes like this :

 

... FROM 'param' ...

 

So it make a SQL error.

 

How can i do for not automatically make quote during the execution ?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

When you want to use any parameter in SQL you will need to use $P!{myParam}. This tells jasper to explicitly insert the value of the parameter into the SQL string.

 

If you wanted to pass a parameter and use it in your where clause then you would need to put the $P!{myPARAM} insides quotes.

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...