If Condition is not validating in the Script

Hi All,

I am getting error when i was trying to validate if condition in the script, I am using global variables and variables in the script,
Here is the scenario
IF ($BANK_ID || ’ ’ || {$GV_OPERATOR} || ’ ’ || {$GV_LIST})
Where Bank_id is the incoming field from the source,
$Gv_Operator is the Operator pulling from DB table
$Gv_List is the list getting from table,
What i was trying to do exactly is,
Ex: IF (10001 IN (‘10001’, ‘10002’, ‘10003’))
But i am unable to parse this, am i doing something wrong with the expression,
Can any one help me in this scenario?

Thanks,
Sushma.


sushma.bommidala (BOB member since 2008-05-02)

you can’t replace the operator in IF with a variable, it should be valid operator (constant value)

the other thing is you can’t pass the list of argument as single variable to IN it should be comma separated list of constants or variable

for example following are valid
IF ($BANK_ID IN ($GV_LIST1, $GV_LIST2, $GV_LIST3))
IF ($BANK_ID IN (10001, 10002, 10003))

if you want to make this expression dynamic then try implementing the logic of checking the operation in custom function which takes both LHS, RHS and Operator as input and write if then else logic for operation

for example:-
evalExpr ($LHS, $OPERATOR, $RHS)
if ($OPERATOR = ‘=’)
begin
if ($LHS = $RHS)
return TRUE;
else
return FALSE;
END

…so on
and in the script check
if (evalExpr(…) = TRUE)

not sure if you will be able to implement IN since you will have to pass the list of values as input


manoj_d (BOB member since 2009-01-02)