<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple tokenizing with Oracle PL/SQL</title>
	<atom:link href="http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:40:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Michael</title>
		<link>http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6788</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 24 Jan 2011 08:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6788</guid>
		<description>DJ: Se my comment above...</description>
		<content:encoded><![CDATA[<p>DJ: Se my comment above&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DJ</title>
		<link>http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6787</link>
		<dc:creator>DJ</dc:creator>
		<pubDate>Sat, 22 Jan 2011 00:04:30 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6787</guid>
		<description>Can you give some example to use with a simple select statement?</description>
		<content:encoded><![CDATA[<p>Can you give some example to use with a simple select statement?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6586</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Wed, 25 Mar 2009 13:50:49 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6586</guid>
		<description>Hey Richard,

thanks for your input!

I need my f_split versions for selects like:

&lt;pre lang=&quot;sql&quot;&gt;
select * from table(f_split(&#039;eins@@zwei@@drei&#039;));
&lt;/pre&gt;

That is i can use it as join table in arbitrary selects.

Have a great day,
Michael.</description>
		<content:encoded><![CDATA[<p>Hey Richard,</p>
<p>thanks for your input!</p>
<p>I need my f_split versions for selects like:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>f_split<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'eins@@zwei@@drei'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>That is i can use it as join table in arbitrary selects.</p>
<p>Have a great day,<br />
Michael.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Filion</title>
		<link>http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6585</link>
		<dc:creator>Richard Filion</dc:creator>
		<pubDate>Wed, 25 Mar 2009 13:33:18 +0000</pubDate>
		<guid isPermaLink="false">http://info.michael-simons.eu/2007/07/18/simple-tokenizing-with-oracle-plsql/#comment-6585</guid>
		<description>Here is an alternate to the above. I also found this on the internet somewhere.

The difference is the f_split will do everything for you (it will parse the whole string) whereas this one will only fecth one at a time. Might be useful for some :-)

This is the procedure:
&lt;pre lang=&quot;pl/sql&quot;&gt;
create or replace procedure tokenizer(iStart   IN NUMBER,
                                      sPattern in VARCHAR2,
                                      sBuffer  in VARCHAR2,
                                      sResult  OUT VARCHAR2,
                                      iNextPos OUT NUMBER) AS
  nPos1 number;
  nPos2 number;
BEGIN
  nPos1 := Instr(sBuffer, sPattern, iStart);
  IF nPos1 = 0 then
    sResult := NULL;
  ELSE
    nPos2 := Instr(sBuffer, sPattern, nPos1 + 1);
    IF nPos2 = 0 then
      sResult  := Rtrim(Ltrim(Substr(sBuffer, nPos1 + 1)));
      iNextPos := nPos2;
    else
      sResult  := Substr(sBuffer, nPos1 + 1, nPos2 - nPos1 - 1);
      iNextPos := nPos2;
    END IF;
  END IF;
END tokenizer;
&lt;/pre&gt;


&lt;pre lang=&quot;pl/sql&quot;&gt;
--This is to test it.
create or replace procedure sp_test_tokenizer as
  sepr   varchar2(1);
  sbuf   varchar2(200);
  sres   varchar2(200);
  pos    number;
  istart number;
begin

  sbuf   := &#039;@0@11@222@3333@44444@555555@6666666@77777777@888888888&#039;;
  sepr   := &#039;@&#039;;
  istart := 1;
  tokenizer(istart, sepr, sbuf, sres, pos);
  if (pos  0) then
    dbms_output.put_line(sres);
  end if;
  while (pos  0) loop
    istart := pos;
    tokenizer(istart, sepr, sbuf, sres, pos);
    dbms_output.put_line(sres);
  end loop;
END sp_test_tokenizer;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Here is an alternate to the above. I also found this on the internet somewhere.</p>
<p>The difference is the f_split will do everything for you (it will parse the whole string) whereas this one will only fecth one at a time. Might be useful for some <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>This is the procedure:</p>
<pre lang="pl/sql">
create or replace procedure tokenizer(iStart   IN NUMBER,
                                      sPattern in VARCHAR2,
                                      sBuffer  in VARCHAR2,
                                      sResult  OUT VARCHAR2,
                                      iNextPos OUT NUMBER) AS
  nPos1 number;
  nPos2 number;
BEGIN
  nPos1 := Instr(sBuffer, sPattern, iStart);
  IF nPos1 = 0 then
    sResult := NULL;
  ELSE
    nPos2 := Instr(sBuffer, sPattern, nPos1 + 1);
    IF nPos2 = 0 then
      sResult  := Rtrim(Ltrim(Substr(sBuffer, nPos1 + 1)));
      iNextPos := nPos2;
    else
      sResult  := Substr(sBuffer, nPos1 + 1, nPos2 - nPos1 - 1);
      iNextPos := nPos2;
    END IF;
  END IF;
END tokenizer;
</pre>
<pre lang="pl/sql">
--This is to test it.
create or replace procedure sp_test_tokenizer as
  sepr   varchar2(1);
  sbuf   varchar2(200);
  sres   varchar2(200);
  pos    number;
  istart number;
begin

  sbuf   := '@0@11@222@3333@44444@555555@6666666@77777777@888888888';
  sepr   := '@';
  istart := 1;
  tokenizer(istart, sepr, sbuf, sres, pos);
  if (pos  0) then
    dbms_output.put_line(sres);
  end if;
  while (pos  0) loop
    istart := pos;
    tokenizer(istart, sepr, sbuf, sres, pos);
    dbms_output.put_line(sres);
  end loop;
END sp_test_tokenizer;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.380 seconds -->

