Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
PlSql String Parser

PlSql String Parser

Ratings: (0)|Views: 26|Likes:
Published by jp_vijaykumar
This script parses a given paragraph/text into individual words and prints in separate lines.
This script parses a given paragraph/text into individual words and prints in separate lines.

More info:

Published by: jp_vijaykumar on Jan 04, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

01/10/2015

pdf

text

original

 
PL/SQL STRING PARSERAuthor JP Vijaykumar Oracle DBADate Jan 4th 2012C shell, Bourne shell, Korn shell.Thanks Denise, your are unique.This pl/sql string parser, parses sentenses, paragraphs and prints each word in a separate line.set serverout on size 1000000 timing ondeclarev_str varchar2(2000):=' the rows of gaping faces staring at me make me mad.words willrefuse to come out of my mouth.fumbling and stuttering starts'; v_wrd varchar2(2000);v_len number;v_ins number;v_chr char(1);begin--v_str:=upper(regexp_replace(regexp_replace(v_str,chr(10),' '),chr(9),' '));v_str:=upper(regexp_replace(v_str,'([[:cntrl:]])|(^\t)',' '));--Will repace all non-printing characters and tabs with spaces<<WHILE_LOOP>>v_len:=length(v_str);while (v_len > 0) loopv_chr:=substr(v_str,1,1); --dbms_output.put_line(v_chr||' '||length(v_chr));if ( v_chr = ' ' ) thenv_str:=substr(v_str,2,length(v_str));goto WHILE_LOOP;elsev_ins:=instr(v_str,' ');if ( v_ins = 0 ) then v_len:=0; v_wrd:=v_str;elsif ( v_ins = 1 ) thenv_str:=substr(v_str,2,length(v_str));goto WHILE_LOOP;elsev_wrd:=substr(v_str,1,instr(v_str,' ') -1);v_str:=substr(v_str,instr(v_str,' '), length(v_str));v_len:=length(v_str);end if;end if;dbms_output.put_line(v_wrd); --||' '||nvl(length(v_wrd),0));end loop;end;/
 
THEROWSOFGAPINGFACESSTARINGATMEMAKEMEMAD.WORDSREFUSETOCOMEOUTOFMYMOUTH.FUMBLINGANDSTUTTERINGSTARTSPL/SQL procedure successfully completed.Elapsed: 00:00:00.01References:http://waltsilva.wordpress.com/2007/10/12/using-regular-expression-functions-in-plsql-to-check-for-complex-password-values/http://stackoverflow.com/questions/2268860/trim-whitespaces-new-line-and-tab-space-in-a-string-in-oraclehttps://forums.oracle.com/forums/thread.jspa?threadID=593376http://laurentschneider.com/wordpress/category/sqlplushttp://download.oracle.com/docs/cd/B12037_01/server.101/b12170/ch13.htmhttp://www.scribd.com/doc/15490898/Oracle-PLSQL-Language-Pocket-Referencehttp://docstore.mik.ua/orelly/oracle/langpkt/ch01_04.htmhttp://vapvarun.com/study/oracle/langpkt/ch01_04.htmhttp://www.databasejournal.com/scripts/article.php/3678311http://www.databasejournal.com/features/oracle/article.php/3684701http://www.rocket99.com/techref/8712.html--------------------------WRITTEN NOV 22ND 2013------------------------------set serverout on size 1000000 timing ondeclarev_str varchar2(4000):='Veeksha Saketh Ishha
 
';v_wrd varchar2(4000):='';begin--v_str:=upper(regexp_replace(regexp_replace(v_str,chr(10),' '),chr(9),' '));v_str:=upper(regexp_replace(v_str,'([[:cntrl:]])|(^\t)',' '));for i in 1..length(v_str) loopif ( substr(v_str,i,1) = ' ' ) thenif ( length(v_wrd) > 0) thendbms_output.put_line(v_wrd);end if;v_wrd:='';elsif ( i = length(v_str) AND substr(v_str,i,1) = ' ' AND length(v_wrd) > 0) thendbms_output.put_line(v_wrd);elsif ( i = length(v_str) AND substr(v_str,i,1) <> ' ' AND length(v_wrd) > 0) thenv_wrd:=v_wrd||substr(v_str,i,1);dbms_output.put_line(v_wrd);elsif ( substr(v_str,i,1) <> ' ') thenv_wrd:=v_wrd||substr(v_str,i,1);end if;end loop;end;/VEEKSHASAKETHISHHAElapsed: 00:00:00.01set serverout on size 1000000 timing ondeclarev_str varchar2(4000):='veekshaishhasaketh';v_wrd varchar2(4000):='';begin--v_str:=upper(regexp_replace(regexp_replace(v_str,chr(10),' '),chr(9),' '));v_str:=upper(regexp_replace(v_str,'([[:cntrl:]])|(^\t)',' '));for i in 1..length(v_str) loop /*if ( substr(v_str,i,1) = ' ' AND length(v_wrd) <> 0) thendbms_output.put_line(v_wrd);v_wrd:='';elsif ( substr(v_str,i,1) = ' ' AND length(v_wrd) = 0) thennull;elsif ( substr(v_str,i,1) <> ' ') thenv_wrd:=v_wrd||substr(v_str,i,1);end if; */

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->