Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Substr and remove characters from field

Re: Substr and remove characters from field

From: Anton Buijs <remove_aammbuijs_at_xs4all.nl>
Date: Wed, 23 Jul 2003 23:55:51 +0200
Message-ID: <3f1f0443$0$49101$e4fe514c@news.xs4all.nl>

jakemoore <member34054_at_dbforums.com> schreef in berichtnieuws 3145080.1058994308_at_dbforums.com...
|
| Actually I am trying to return just the filename with no extension.
|
| Also the path will be different everytime so one time it could have 3
| slashes the next could have 4.
|
| --
| Posted via http://dbforums.com

So what? In the solution I posted the INSTR searches for the first "\" from the *right* from the given value. Therefore it does not matter how many subdirs the path contains. That value +1 is taken as an argument for SUBSTR. The same thing can be done again to strip the extention. I would again look for the first "." from the *right* (in case the filename containts more dots) and SUBSTR another time from that positon +1. It can still be done in 1 line, with 1 SUBSTR and 2 INSTR function calls. But I don't want to spoil your pleasure working with Oracle by writing it out complety! Received on Wed Jul 23 2003 - 16:55:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US