APEX items and implicit type conversion

Be aware when using bind variables or the V function to reference an Oracle APEX item in your SQL statements or your PL/SQL code that APEX/Oracle always stores this values as VARCHAR2′s in its internal arrays!


So each time you reference an item with :YOUR_ITEM or V(‘YOUR_ITEM’) the SQL/PL-Sql engine does a implicit data type conversion.

Don’t rely on implicit data type conversion as the Oracle manual already says!

To ensure your program does exactly what you expect, use explicit conversions wherever possible.

Maybe it will work most of the time, but I would suggest to use the NV function to get the value of numeric items or use TO_NUMBER, TO_DATE, … around your bind variables eg. TO_NUMBER(:YOUR_ITEM).

For details see the Oracle manuals: