Error in IS_NUMBER Function PL/SQL!!
Hi Experts,
I have a pl/sql function for checking the input is numeber or not and it needs to retrun BOOLEAN value. Here is the code for that,
CREATE OR REPLACE function is_number(in_var in varchar2)
return BOOLEAN
is
v_number number;
begin
if in_var IS NOT NULL THEN
v_number := to_number(in_var);
return TRUE; -- No exception, so is a number
else
return FALSE;
end if;
exception
when others then
RAISE;
end;
When i run the above function,
select is_number('1') from dual;
Its errored out saying,
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
Please let me know where i am wrong.
Thanks,
G