Converting Character Numbers to Integers
Using PL/SQL, how can I convert a string containing numbers to integers?
The count of numbers can vary and the spaces between numbers can vary.
For example, assume this:
INPUT 1: DATA VARCHAR2(50) (‘ 10 39.78 18.6 12.34 276 55.5678 ‘)
OUTPUT 1:
INT_1 NUMBER(10,4) (10)
INT_2 NUMBER(10,4) (39.78)
INT_3 NUMBER(10,4) (18.6)
INT_4 NUMBER(10,4) (12.34)
INT_5 NUMBER(10,4) (275)
INT_6 NUMBER(10,4) (55.5678)
INPUT 2: DATA VARCHAR2(50) (‘ 2743 8 17 467.1 ‘)
OUTPUT 1:
INT_1 NUMBER(10,4) (2743)
INT_2 NUMBER(10,4) (8)
INT_3 NUMBER(10,4) (17)
INT_4 NUMBER(10,4) (467.1)
Thank you!