Hi all,
I have a stored proc that takes in parameters (from_threshold_value varchar(10), to_threshold_value(10). These need to be strings for another reason I won't go into.
What I have is a HAVING clause in which I want to restrict the fact Aggr field based on the from and to thresholds the user types in.
However, when I run it, I get the error

QL0420N - Invalid character found in a character string argument of the function DECIMAL.
I don't understand why I'm getting this as the character string is typed in as it's a prompt so it's not as if I'm typing in something that can't be converted to a decimal. I've also tried using CAST as well.
A simplified part of the SQL is below, any ideas would be appreciated. Thanks.
HAVING
SUM(COALESCE(ODW.FACT_EVENT.TOTAL_EVENT_IMPACT,0)) < DECIMAL(LTRIM(RTRIM(to_threshold_value)),12,2)