PL-SQL Solve: Using INSTR and SUBSTR
I am trying to work on this and cannot get a solution. Please help
You have to use INSTR and SUBSTR to solve
Question:
You have the following acceptable value
Numberic: 0-34
80-100
or Non Numberic X S U D- D D+
Im have to use INSTR and SUBSTR functions to test that the value is a valid (as above) number before TO_NUMBER is called:
SELECT TO_NUMBER('?? ') //HERE ?? and a space (for 100 etc) is for the values as above
FROM DUAL
WHERE ....INSTR(......)<=;
(Hence if the number is true then number comes back or it says no rows)
and also id non numberic it should also be tested.
I am completely unsure about it but tried this
SELECT TO_NUMBER('34 ')
FROM DUAL
WHERE INSTR('0123456789',1,1)<=9 (looking at first number ?)
AND
INSTR('0123456789',2,2)<=9
AND
INSTR('0123456789',3,3)=0;
Please help