Sunday, March 7, 2010

Digit only in oracle

FUNCTION DIGIONLY(VAL VARCHAR) RETURN BOOLEAN IS
incre number(10) := 0;BEGIN --loop for checking the every elment in of text field enter by user. LOOP incre := incre + 1; IF substr(trim(VAL),incre,1) not in ('0','1','2','3','4','5','6','7','8','9') then message('Please enter numeric value'); return false; end if; EXIT When LENGTH(trim(VAL)) <= incre; END loop;
return true; EXCEPTION WHEN OTHERS THEN message('Please enter numeric digit only value'); RETURN FALSE; END;

1 comment:

  1. I regularly follow your blog and I get to know lot of useful things. This post includes very basic concept of Digit in Oracle. The method is very easy so you can try it. I am looking forward to see your work. This is the best way to explain this thing.
    sap erp financials

    ReplyDelete