Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Urgent: Insert Oracle Blob fields with DBExpress

37 views
Skip to first unread message

Mihai Togan

unread,
Dec 11, 2001, 7:30:19 PM12/11/01
to

Can anybody explain me how could I make a parameter binding with DBExpress
for inserting an Oracle 8.x BLOB field ?

Shortly, I want to write a binary file into BLOB field. All I have done
until now didn't work.

Any source of information will be wellcome

Thanks.
Mihai


Ramesh Theivendran (BORLAND)

unread,
Dec 11, 2001, 10:51:12 PM12/11/01
to
ORACLE BLOB and CLOB needs locators to bind data and you need a SQL like
"INSERT INTO TAB (FBLOB, FCLOB) VALUES ( EMPTY_BLOB(), EMPTY_CLOB()) RETURNING
FBLOB INTO :p1 AND FCLOB INTO :p2"

Bind p1 and p2 as ftOraBlob and ftOraClob respectively.

T.Ramesh.

Mihai Togan wrote:

--
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of
this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto, is
strictly prohibited. If you have received this e-mail in error, please
immediately and permanently delete the original and any copy of any
e-mail and any printout thereof.


Accelerate your Linux® application development with Kylix(TM), the RAD
tool for Linux. Easily integrate web, desktop and database development
to quickly deliver fast Linux applications. Kylix is the only Linux
development tool that combines the world's fastest compiler with the
most productive visual design environment for GUI, web and database
programming. Order your copy now!
http://www.borland.com/kylix/


Mihai Togan

unread,
Dec 13, 2001, 5:49:14 PM12/13/01
to

Well, I used the following code from Delphi6 (Kylix2) :

procedure TForm1.Button1Click(Sender: TObject);
var sSql:string;
params:TParams;
mstrm:TMemoryStream;
begin
mstrm:=TMemoryStream.Create;
mstrm.LoadFromFile('filename');
mstrm.Position :=0;
params:=TParams.Create;

params.CreateParam(ftOraBlob,'p1',ptInput);
sSql:='Insert Into MyTable ( Id, blobfield) Values( 61,
EMPTY_BLOB()) Returning blobfield into :p1';
DataModule1.SQLConnection1.Execute(sSql, params,nil);
params.ParamByName('p1').SetBlobData(mstrm.Memory,mstrm.Size);
params.Free;
mstrm.Free;
end;

When I execute this code, it makes an insertion af an record into Oracle
MyTable table with Id=61 but the BLOB filed is empty. Can you tell me what
is wrong? Any idea ?

Thanks,
Mihai.

0 new messages