Validation to Check for Item Length
cloakedSep 10 2008 — edited Sep 15 2008Greetings,
I have a column that is defined with a length of 240 in the table, and I want to give a validation error if the user enters more than 240 into the corresponding item on the Apex page. I have this code in my validation routine and it is listed as PL/SQL:
TO_NUMBER(LENGTH(:P10_ACTIVITY_COMMENT)) < 241
When I save a record with a comment more than 240 the validation error appears, but an Oracle error also shows at the top of the page:
"Invalid PL/SQL expression condition: ORA-06502: PL/SQL: numeric or value error: character to number conversion error Invalid PL/SQL expression condition: ORA-06502: PL/SQL: numeric or value error: character to number conversion error"
I've changed the code in a few different ways, but they all give the Oracle error.
How should I code it?
Thanks, Tony