RE: wht is the logic to find whether the entered inpu...
The value will be given as parameter inside ascii() function ------------------------------------------------------------------------------ SELECT DECODE(COUNT(N) 0 'CHARACTOR' 'NUMBER') FROM ( SELECT 1 N FROM DUAL WHERE ASCII('A') BETWEEN 48 AND 57 ) WHERE N(+) 1
RE: wht is the logic to find whether the entered input is a number or the character. How can we design this program using a procedure or the function
You can check this by using translate function. If the return value is NULL then the input is a number else it is character or alpha numeric. Ex: select ('abcd' '~0123456789' '~') from dual; -- Will return a non null value select (123 '~0123456789' '~') from dual; -- Will return a null value select ('123' '~0123456789' '~') from dual; -- Will return a null value select ('123a' '~0123456789' '~') from dual; -- Will return a non null value select ('' '~0123456789' '~') from dual; -- Will return a null value. Ensure you dont pass null values.