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

Home -> Community -> Usenet -> c.d.o.server -> Re: Updating a CLOB

Re: Updating a CLOB

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Wed, 27 Oct 2004 19:14:03 -0700
Message-ID: <1098929585.29937@yasure>


Sfole wrote:

> Hi, I need help in updating a clob...What I do is to insert a record
> like below, then I need to update the record with a new file1.txt but
> I don't succeed in updating the record...can someone help me please?
> **********************************************************
> CREATE OR REPLACE DIRECTORY DOCUMENTS AS '&nome_dir';
>
> DECLARE
> v_bfile BFILE;
> v_clob CLOB;
> v_file_name VARCHAR2(1000) := 'File1.txt';
>
> BEGIN
> INSERT INTO table1(a1,b1,c1,d1)
> VALUES(1,2,empty_clob(),3)
> RETURNING c1 INTO v_clob;
>
> v_bfile := BFILENAME('DOCUMENTS', v_file_name);
> Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
> Dbms_Lob.Loadfromfile(v_clob, v_bfile,Dbms_Lob.Getlength(v_bfile));
> Dbms_Lob.Fileclose(v_bfile);
> END;
> /
> DROP DIRECTORY DOCUMENTS;
> *********************************************************
> THX
> Sfole

I'm running out the door and don't have time to determine what your code is or is not doing. But one thing it isn't doing for sure is committing the change to the database.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Oct 27 2004 - 21:14:03 CDT

Original text of this message

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