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: instr does not work with filenames containing more that 2 '/' s. Any ideas ???

Re: instr does not work with filenames containing more that 2 '/' s. Any ideas ???

From: Mark Townsend <markbtownsend_at_attbi.com>
Date: Tue, 30 Apr 2002 05:20:55 GMT
Message-ID: <B8F377C3.1FB95%markbtownsend@attbi.com>


in article 660d539f.0204292057.51ca1571_at_posting.google.com, Krishna at krishna321_at_hotmail.com wrote on 4/29/02 9:57 PM:

> Hi,
> I am trying to determine the exact position of the third '/'
> character in a filename string containing more than 3 three '/'
> characters, both from the beginning as well as from the end. For some
> strange reason, the instr function always seems to be returning the
> value of the 2nd '/', depending on the point of search (beginning of
> the string or the end of the string).
>
> For eg :-
>
> select instr('/apps/oracle/product/8.1.7/network/admin/tnsnames.ora','/',3)
> from dual;
>
> will return the value 6, which should be the same if the value '3'
> were substitued by '2'.
>
> If searching from the end of the string as in
>
> select instr('/apps/oracle/product/8.1.7/network/admin/tnsnames.ora','/',-3)
> from dual;
>
> The above instr statement, will always return 41, which should be the
> same if the '-3' were substituted with '-2'.
>
> Is this a bug or am I missing something ? Please help !!!
>
> Best Wishes,
> krishna.

instr(string, substring, position, occurence)
                                   ^^^^^^^^^

Note the 4th parameter
- see
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/ a85397/function.htm Received on Tue Apr 30 2002 - 00:20:55 CDT

Original text of this message

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