Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL-SQL Solve: Using INSTR and SUBSTR

user463321Nov 15 2005 — edited Nov 15 2005
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2005
Added on Nov 15 2005
8 comments
669 views