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!

Using substr / instr to parse a filepath help

NewApexCoderNov 5 2013 — edited Nov 5 2013

I'm having trouble parsing a string per say using sql. I have a column full of file paths. The file paths are similar to:

C:\Users\Guest\Pictures\example.jp

I want to be ablt to grab just the file name of the image. I've been working on several variations of a query using the substr function and the instr function. I've come up with the query below. FILEPATH is the name of the column. So far it gives me the file name, but has the '\' in front of it. Can anyone help me get rid of this. Thanks in advance.

Select substr(FILEPATH, (instr(FILEPATH,'\',-1,1)))

from Table_Name

where ID = '101'

This post has been answered by Frank Kulash on Nov 5 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2013
Added on Nov 5 2013
3 comments
1,690 views