Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Substr and remove characters from field
The statements work for any number of slashes:
SQL>set serveroutput on size 1000000; SQL> SQL>Accept dir prompt 'Directory name? 'Directory name? c:\test\hello\people\file.tif SQL>
5 v_path:=substr('&&dir',1,instr('&&dir','\',-1)); 6 V_filenm:=substr('&&dir',instr('&&dir','\',-1)+1); 7 v_filenm:=substr(v_filenm,1,instr(v_filenm,'.',-1)-1);8 dbms_output.put_line('Path is: '||v_path); 9 dbms_output.put_line('File name is: '||v_filenm); 10 end;
-- Posted via http://dbforums.comReceived on Wed Jul 23 2003 - 16:30:01 CDT
![]() |
![]() |