Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> pl/sql question and owa_pattern question
Hi:
In my pl/sql program, I want to process each "word" in a string. The string is selected from a varchar2(300) column. The delimit that separates the words is not necessary space character. The definition of the delimit in this program is set as
Now my program is basically checking each character, find the delimit, and rebuild each word. After that I process each "word". The code looks like this:
if word is not null then -- do some processing to variable word ! word := null; -- reset it end if; else word := word || ch; -- concat ch to wordend if;
I think It's taking too long because it loops through each characters. I hope I could find a way to speed it up. I don't have experiience in owa_pattern, but I thought there might be a way to do it here:
pos := owa_pattern.amatch(newstr, 1, '\W'); -- how can I mask out these '-.,/<*>_' ???
word := substr(newstr, 1, pos-1);
My simple tests showed that owa_pattern call is much slower than direct string manupilation. But I would like to try it in this case if I could easily get the "wrods" from the string. Any suggestions?
TIA. Guang
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Guang Mei
INET: gmei_at_incyte.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Nov 20 2003 - 21:39:55 CST
![]() |
![]() |