Hi:

In pl/sql, I want to add chr(10) into a string in every 70th position. The
string can be up to 2000 characters long. The follwoing code works. But is
there an even FASTER way to do this?

Thanks.

Guang

---
declare
  pos   number := 1;
  len   number;
  buf   varchar2(2000);
  x varchar2(2100);
begin
  buf :=
'012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789A';

  len := length(buf);
  while pos<=len loop
    x := x || substr(buf, pos, 70) || chr(10);
    pos := pos+70;
  end loop;

end;

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Guang Mei
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to