Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> DBMS_LOB and PLSQL

DBMS_LOB and PLSQL

From: Ole <ole_at_atomb.dk>
Date: Wed, 21 Jan 2004 14:20:18 +0100
Message-ID: <m0vPb.2188$dz2.1760@news.get2net.dk>


Hi there

I'm trying to make a large-text-container-system in a 8.17 database using plsql, dbms_lob and htp-package.
I'm using a table with a clob column and wants to recieve data fra a html-form and put it into the clob.
In the manual it says that the clob can contain 4GB, but I can't get it to recieve more than 32K.

Is this a limitation in PLSQL or the LOB-concept. ?

Is there a workaround, still using the CLOB, or do I have to use another soloution, which.?

Thanks in advance

Ole

My code and tech.:



set define off

--
--  create table clobtest (title varchar2(80), text clob);
--  DB: 8.17  OAS 4.08
--
CREATE OR REPLACE PACKAGE container IS
   PROCEDURE preface;
   PROCEDURE edit_text      (v_title in varchar2, v_text in varchar2);
   PROCEDURE show_text  (v_title in varchar2);
   FUNCTION  authorize RETURN BOOLEAN;
END;

/
show errors CREATE OR REPLACE PACKAGE BODY container IS FUNCTION authorize RETURN BOOLEAN IS BEGIN RETURN true; END; PROCEDURE preface IS cursor texts is select * from clobtest order by title; BEGIN for text in texts loop htp.p('<a href="container.show_text?v_title='||text.title||'" target="_new">'||text.title||'</a><br>'); end loop; htp.p('<form method="post" action="container.edit_text">'); htp.p('<input type=text name=v_title><br><br>'); htp.p('<TEXTAREA NAME="v_text" ROWS="15" COLS="100" WRAP="VIRTUAL"></TEXTAREA>'); htp.p('<INPUT TYPE="SUBMIT" VALUE="Save">'); htp.p('</form>'); EXCEPTION WHEN OTHERS THEN htp.p(sqlerrm); END; PROCEDURE edit_text (v_title in varchar2, v_text in varchar2) IS BEGIN insert into clobtest values (v_title, v_text); preface; EXCEPTION WHEN OTHERS THEN htp.p(sqlerrm); END; PROCEDURE show_text (v_title in varchar2) IS l_text clob; l_text_vc varchar2(4000); lgd number; i number := 0; t_i number; BEGIN select text into l_text from clobtest where title = v_title; htp.p('The CLOB has the following length: '); lgd := DBMS_LOB.GETLENGTH(l_text); t_i := lgd / 4000; htp.p(lgd); htp.p('<br>This is the content of the CLOB<br>'); while i <= t_i loop l_text_vc := dbms_lob.substr(l_text,4000,((i*4000)+1)); htp.p(l_text_vc); i := i +1; end loop; EXCEPTION WHEN OTHERS THEN htp.p(sqlerrm); END; END;
/
show errors
Received on Wed Jan 21 2004 - 07:20:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US