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: Krishna <krishna321_at_hotmail.com>
Date: 8 May 2002 09:38:59 -0700
Message-ID: <660d539f.0205080838.6f573c79@posting.google.com>


Hi Stan,
 My oracle versions are 8.1.7.3 on WIN 2000 and 9.0.1 ON HP-UX 11. I wonder what changed between 8.1.7.2 and 8.1.7.3 and 9i that I'm not getting the result ...

 Thanks for your reply. I appreciate the response.

Stan <stan0074_at_yahoo.com> wrote in message news:<3CD0DE99.8000801_at_yahoo.com>...
> Krishna,
>
> It works for me on 8.1.7.2. What oracle version are you trying this ?
>
> select
> instr('/apps/oracle/product/8.1.7/network/admin/tnsnames.ora','/',3, 2)
> from dual;
>
> INSTR('/APPS/ORACLE/PRODUCT/8.1.7/NETWORK/ADMIN/TNSNAMES.ORA','/',3,2)
> ----------------------------------------------------------------------
> 13
>
> -Stan
>
>
> Krishna wrote:
>
> > Hi Svend,
> > Using the fourth entry (occurence of search string) for the instr
> > command, does not help either. Same results. It looks like instr has a
> > problem with the special characters such as
> > '/', '&' etc and not with word characters.
> >
> > Thanks for your reply.
> >
> > Best Wishes,
> > krishna.
> >
> > Svend Jensen <Svend_at_OracleCare.Com> wrote in message news:<3CCE893F.7080107_at_OracleCare.Com>...
> >
> >>Krishna wrote:
> >>
> >>
> >>>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.
> >>>
> >>>
> >>Hi Krisna,
> >>
> >>instr is used with 4 values; ie. instr('string','search_string',
> >>search_from_position, #occurence_of_search_string).
> >>You search for '/' (first occurence of) from position 3 or -3.
> >>Check the manual.
> >>
> >>Rgds
> >>/Svend Jensen
> >>
Received on Wed May 08 2002 - 11:38:59 CDT

Original text of this message

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