RussellW6092 Member since 2018 4 posts
Vodafone UK Ltd
Posted: November 15, 2019
Last activity: November 15, 2019

Paramerising Function-Alias Causing Error


I am trying to build a function-alias rule to take in paramertised inputs into an interval calculation to improve run time over the current Difference In Day/Min/Hour Function currently provided.

String parameter2 = tools.getStepPage().getString(".pyParameters(2).pyParametersParamValue").replaceAll("\"","").replaceAll("'","");
<p:when java="<%= parameter2.equals("days") %>">
now()::date - interval '{1} days'
ERROR : Unknown Interval Type

On Execution I am getting the error:

An error occured on executing the query for the report definition - There was a problem getting a list: code: 0 SQLState: 22023 Message: The column index is out of range: 1, number of columns: 0. DatabaseException caused by prior exception: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0. | SQL Code: 0 | SQL State: 22023

However hardcoding the value allows it to work sucessfully.

Any ideas how I can pass a parameter into a '' encapsulated string?

I have attached screenshots for reference.

Many Thanks In Advance

Pega Platform Reporting
Moderation Team has archived post
Share this page LinkedIn