CREATE OR REPLACE FUNCTION isnumber(p_val IN VARCHAR2) RETURN NUMBER IS l_val NUMBER; BEGIN l_val := TO_NUMBER(p_val); RETURN

1; EXCEPTION WHEN VALUE_ERROR THEN RETURN 0; END; SELECT SYSTEM.Isnumber(SUBSTR(NUM_IDEN,1,LENGTH(NUM_IDEN)-1)),NUM_IDEN FROM MEM O_VIEW_ENCABEZADOCIF ORDER BY 1 then SQL> SELECT Isnumber('123') FROM dual; ISNUMBER('123')--------------SQL> SELECT Isnumber('12A') FROM dual; ISNUMBER('12A')--------------It can also be used directly in a PL/SQL 1 0

Sign up to vote on this title
UsefulNot useful