Oracle Function Accepting Precision 2 Number
in oracle plsql function or procedure prototype you can just specify datatype and not length or precision and so you want control length or precision you should handle it in your function or procedure body for example:

create or replace FUNCTION ftest(x NUMBER) RETURN NUMBER IS
BEGIN
    if length(x) &gt; 2 then
    return;
    end if;
    RETURN 42; -- body of function is not relevant for this question
END;


Or

create or replace FUNCTION ftest(x NUMBER) RETURN NUMBER IS
t number(2);
BEGIN

    t:=x;
    RETURN 42; -- body of function is not relevant for this question
    EXCEPTION WHEN VALUE_ERROR THEN
    RETURN -1;

END;