Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: String manipulations HELP!!!!
I have used SUBSTR, LENGTH, INSTR, LTRIM, RTRIM to get the value of fid in the URL.
SUBSTR(char, m, n) returns portion of char beginning at character m and
n characters long
INSTR(char1, char2) searches char1 for the occurence of char2 and
returns the position of the character in char1 (the furst occurence of
the character)
LENGTH(char) returns the length of char
LTRIM(char, set) removes characters from the left of char with all the
leftmost characters that appears in set removed
LTRIM(char, set) returns char with all the rightmost characters that
appear in set removed
Below is an example that retrieves the value of fid in a URL:
CREATE OR REPLACE PROCEDURE FIND_FID_VALUE IS
v_end number := 0; v_url varchar2(400); v_start number := 0; v_test varchar2(100); v_test_trim varchar2(100); v_start_trim number := 0; v_end_trim number := 0;
BEGIN
select url
into v_url
from a_table;
v_trim := substr(v_test, v_start_trim, v_end_trim);
v_final_string := rtrim(ltrim(v_trim, 'fid='),';');
htp.print('final :'||v_final_string);
htp.br;
END FIND_FID_VALUE; hope that helps
In article <94ibfc01e2a_at_drn.newsguy.com>,
Dan White <dwhite_at_icimail.com> wrote:
> PLEASE HELP
>
> 2)I have a column which contains a http url string
>
http://ad.doubleclick.net/ad/main.cdnow/RP/SHARE/sound_popup.html;sz=250
x250;gid=;fid=85475;artid=;itmid=;formatid=;promoid=;kword=;collid=;fmta
g=;adloc=top_center;lang=ENG;ord=535276841_0?
>
> In this string i am looking FID=85475 ( or what ever number is after
fid) this
> string can be anywhere in this string.
>
> PLEASE HELP
>
> Dan White
> programmer/analyst
>
> Dan White
> programmer/analyst
>
Sent via Deja.com
http://www.deja.com/
Received on Mon Jan 22 2001 - 19:57:42 CST