Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Substr and remove characters from field
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
![]() |
![]() |