Jump to content

How mix parameter $P and $P! in query ?


d.taillade
Go to solution Solved by hozawa,

Recommended Posts

Hello,

I need to mix parameter $P and $P! in query to do a single report. But I don't manage, I have an errror in query.

I have a first parameter "WITH_NUMFACT" and according to it I do :

  • if 1 then numfact = param_numfact
  • else tri = param_tri and another substitution

Here the query parameter (Q_WITH_NUMFACT) :

($P{WITH_NUMFACT} == 1) ? " AND FACTUR_MAITRE.NUMFACT =  $P{NUMFACT} " : " AND FACTUR_MAITRE.FLAG_TRI >= nvl( $P{TRI} ,1) $P!{Q_IN_NOTIN}"[/code]

And in my query I do :

SELECT my_columns FROM my_table WHERE 1=1 $P!{Q_WITH_NUMFACT}[/code]

If I show the parameter Q_WITH_NUMFACT, the result is :

 AND FACTUR_MAITRE.FLAG_TRI >= ((java.lang.Integer)parameter_TRI.getValue()),1)$P!{Q_IN_NOTIN}[/code]

The system doesn't translate the parameters.

How do it ?

Many thanks in advance for your help !!

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

What you need to do is to escape $P{..} with $$P{..} in the Q_WITH_NUMFACT expression so that they are interpreted literally:

($P{WITH_NUMFACT} == 1) ? " AND FACTUR_MAITRE.NUMFACT =  $$P{NUMFACT} " : " AND FACTUR_MAITRE.FLAG_TRI >= nvl( $$P{TRI} ,1) $P!{Q_IN_NOTIN}"[/code]

Regards,

Lucian

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