5 pts.
0
Q:
How to parse a string
Hi, I have a file name that has multiple nodes, I want to get the file extension after the last '.'.
How do I do this?
ASKED: Aug 21 2008  8:06 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
155 pts.
0
A:
 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0
  • AddThis Social Bookmark Button
Use INSTR

DECLARE
v_pos NUMBER;
v_string VARCHAR2(20) := 'abc.123.txt';
v_file_type VARCHAR2(20);
BEGIN
v_pos := INSTR(v_string, '.', -1);
v_file_type := SUBSTR(v_string, v_pos + 1);
DBMS_OUTPUT.PUT_LINE(v_file_type);
END;
/
Last Answered: Aug 22 2008  9:42 AM GMT by MikeR   155 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0