Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CLOB variable: concatenate or append?

Brian TkatchJun 22 2012 — edited Jun 22 2012
I just wrote a FUNCTION to return XML from a web service. As the text can go over 32,767 characters, i figured a CLOB was the way to go:
 FUNCTION Get_XML(I_URL VARCHAR2)
 RETURN XMLTYPE
 AS

  Page		CLOB;
  Response	UTL_HTTP.HTML_PIECES;

 BEGIN 

  Response := UTL_HTTP.REQUEST_PIECES(I_URL);

  -- UTL_HTTP.REQUEST_PIECES returns 2000 byte chunks.
  FOR Chunk IN 1..Response.Count
  LOOP
   Page := Page || Response(Chunk);
  END LOOP;

  RETURN XMLTYPE(Page);

 END Get_XML;
My question is, is about the best way to concatenate the pieces. Is
Page := Page || Piece(Counter);
good, or should i be using DBMS_LOB.APPEND or similar?
This post has been answered by Purvesh K on Jun 22 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2012
Added on Jun 22 2012
7 comments
2,697 views