Jump to content

modify parameter value before using it in query


lexx_pangcats

Recommended Posts

Hi all,

Does anyone know how to modify parameter value before using it to select query?

Because I just want to filter any values from parameter.

I know we can do it in the server side(java code) but the limitations are I'm not allowed to modify any codes.

So all I have to do is to depend what values are send through the parameter.

Hope you understand my issue.

 

Tnx.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This is one of the most common question, I should write a FAQ for that.

To calculate a parameter from another they must be in the right sequence. Suppose you have the parameter PARAMETER_1 The default value expression of a PARAMETER_2 can be something like: com.mypacka.MyUtility.do_somehting_with( $P{PARAMETER_1} ) 

 

Of course in the query you should use PARAMETER_2

Giulio
 

Link to comment
Share on other sites

what i mean is how to modify a parameter value before using it in the query.

for example i have:

$P{parameter1} = "1,2,3,...................100".

 

and my i query:

select * from table where col = ${parameter1}

 

But before I execute the query i want to change the value of the parameter.

Just like for example, when the number of characters of the parameter $P{parameter1} is greater than 8000 then im going to cut down the value of the parameter to not greater than 8000.

 

Link to comment
Share on other sites

hi guilo,

 

thanks for the reply.

 

your ideas are great.this solve my issue. but it looks messy if i've to create 60 parameters.

Because in my case, there's a posibility that the number of characters inside the parameter could be in 240,000. and i think 4,000 characters only allowed to stored in every parameters. that would result to 60 parameters will be created.

 

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