Re: View from CLOB chunks

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 18 Nov 2008 22:18:39 -0000
Message-ID: <4POdnYz0iJmmor7UnZ2dnUVZ8r2dnZ2d@bt.com>


<yuri.dench_at_gmail.com> wrote in message news:8a22f11a-c250-4dd4-adff-9d9e7145d157_at_e1g2000pra.googlegroups.com...
> Hello,
> Is it possible to creare a view that will split single CLOB column
> into multiple chunks of VARCHAR2 something like this:
>
> TABLE:
> ---------------------------
> ID INTEGER
> DATA CLOB
>
> into VIEW:
> --------------------------------------------------
> ID INTEGER
> CHUNK_ID INTEGER
> DATA VARCHAR(1000 char)
>
>
> Thanks, Yuri

You could write a pipelined function that takes the ID value for a row, and pipes back a list of (line_number, clob_chunk).

You could then create a view that uses this function in a lateral join with the clob table.

-- 
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html
Received on Tue Nov 18 2008 - 16:18:39 CST

Original text of this message