Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to split up a long into parts ?
A copy of this was sent to "Benny Derous" <bderous_at_roularta.be>
(if that email address didn't require changing)
On Mon, 21 Jun 1999 17:03:11 +0200, you wrote:
>Hi,
>
>I need to break up a long into four parts of the datatype varchar2.
>
>
> long (+- 1000 bytes) => 4 x varchar2(250)
>
>So, i have one record with a long and i have to split it up
>into 4 records with varchar2(250). How do i do this ?
>
>Thanx,
>
>Benny Derous
>bderous_at_roularta.be
>
as long as the long is <32, you can use plsql to do this easily... for example:
begin
for x in ( select long_column from T ) loop
for i in 1 .. 4 loop dbms_output.put_line( substr( x.long_column, 250*(i-1)+1, 250 ) ); end loop;
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Fine Grained Access Control", added June 8'th
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jun 21 1999 - 10:14:45 CDT