Null value passed in condition removes clause condition
When an Obj-Browse is used with a parameter as the comparison value, if that parameter is null, then where clause condition is removed from the generated SQL.
Set up an Obj-Browse with a single condition, to match .pzInsKey with Param.Handle - When no value is placed in Param.Handle, the generated SQL shown in the tracer does not have a condition on pzInsKey.
Instead of generating the SQL query without this condition included, User would expect for the condition to be retained, but a check to be done for null values.
No error message.
Where clause is discarded when there is no value present in the filter parameter for Obj-Browse method.
Steps to Reproduce
1.Create an activity with one input parameter (eg:Param.Handle) and an Obj-Browse step.
-Note: The Obj-Browse must have a single condition, matching .pzInsKey to Param.Handle.
2. Run the activity, and leave Param.Handle blank
This causes the condition to check on pzInsKey to be removed from the generated SQL.
The root cause of this problem is a defect in Pegasystems’ code/rules.
This is the expected behaviour with Obj-browse method. Even the Listview and ReportDefinition shows the exact behaviour. But in reports there is an option to treat the empty value in parameter as null.
The explanation for this behavior is as follows:
This is the expected behaviour for Obj-Browse method.
There is an enhancement request already existed to enhance the behaviour with this Obj-Browse method. This will be fixed in future releases of PRPC.
100% found this useful