Home » SQL & PL/SQL » SQL & PL/SQL » Blob
Blob [message #21578] Thu, 15 August 2002 09:48 Go to next message
Luciana
Messages: 1
Registered: August 2002
Junior Member
How insert a blob in oracle?
Re: Blob [message #21580 is a reply to message #21578] Thu, 15 August 2002 12:44 Go to previous message
scott
Messages: 73
Registered: September 1999
Member
I had to do this once and it took me a week to figure it out (CLOB not a BLOB, but I think it should be the same). Basicly what I ended up doing is, I had a form with three CLOB fields, when the form was submited I wrote the CLOB fields to the C drive of the web server as .txt files. I then FTP'd them to my database sever. Next I called a procedure that took the .txt files from the database server and inserted them into the database. I'm sure this is a round-about way to do this, but it works... It does take some time to write and FTP them, sometimes as much as 5-8 seconds. My code for the procedure is below:

PROCEDURE MASTER_MODIFY_DESC
(TID IN NUMBER)
AS
description_b bfile;
description_c clob;

BEGIN
UPDATE task
SET
task_description2 = empty_clob()
WHERE task_id = TID

return task_description2 into description_c;
description_b := bfilename('DESCRIPTION', 'description.txt');

/*package here*/
DBMS_LOB.FILEOPEN(description_b, DBMS_LOB.FILE_READONLY); --open file.
DBMS_LOB.LOADFROMFILE(description_c, description_b, DBMS_LOB.GETLENGTH(description_b)); --load file.
DBMS_LOB.FILECLOSE(description_b); --close file.

commit;
END;
Previous Topic: collection in where clause
Next Topic: Convert Datatype
Goto Forum:
  


Current Time: Thu Apr 25 00:45:26 CDT 2024