Hi, I want to check my Input field, whether it is numeric or not. There seems to be no such function in Oracle 8i. If it's not numeric, I get the message 'invalid number', so I need to check before inserting into database. I can use the 'translate'-function, but that seems too complicated! Thanx for helping, Lars
Hi there Write a stored pl/sql function to check it as described below: <br> create or replace function isNumeric ( i_value_to_check varchar2) return number is v_dummy number; begin v_dummy := to_number( i_value_to_check); return 1; -- it's number exception when others then return -1; -- it's invalid end isNumeric; / <br> regards,
Thanks for helping, but I wasn't looking for a new function. I hoped for a function that is already implemented in Oracle. I did it this way now: "( ( decode ( trim ( translate ( translate( "+checkValue+", ' ', 'x')" + ", '0123456789', ' ' ) ) " + ", '', '0'" + ", '.', '0'" + ", '1' ) ) " + " = '1' )"
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad: