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: String function

Re: String function

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 26 Aug 2003 06:12:22 -0700
Message-ID: <2687bb95.0308260512.3cbd56de@posting.google.com>


"Max" <massimo.panero_at_ideainformatica.org> wrote in message news:<bifarn$8hvkb$1_at_ID-121437.news.uni-berlin.de>...
> Is there a function that return how many occurrence of a substring are in a
> string?
> Or how can i do by myself?
> Example:
> ST := 'THIS IS A STRING';
> N := XFunction ( ST, 'S' ); // return 3
> N := XFunction ( ST, 'IS' ); // return 2
> N := XFunction ( ST, 'X' ); // return 0

The single row functions available in Oracle are documented in the SQL manual. See instr.

v_first := instr(v_drawing_date,'/',1,1) ; v_second := instr(v_drawing_date,'/',1,2) ; if v_first = 3 then

      v_mm := substr(v_drawing_date,1,2) ; ...

In its simple form: v_test := instr(v_drawing_date,'DEC') instr returns the position of DEC in v_drawing_date or 0 if not found

HTH -- Mark D Powell -- Received on Tue Aug 26 2003 - 08:12:22 CDT

Original text of this message

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