BLOB and insert command

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

BLOB and insert command

Post by zvasku » Thu 12 Apr 2007 12:26

Hello,

we have problem with TSQLQuery like this:

insert into TABLE(ID,DATA) values(1,:DATAPAR)

field data is blob. If we use

SQLQuery1.ParamByName('DATAPAR').LoadFromStream(Stream,ftBlob)

and size of stream is larger than 4000 bytes then ExecSQL returns ORA-01460.

Do we have to use another way to store such a value to db or is there someting wrong?

Best regards
Zdenek, Dbexpoda30.dll 3.1.0.7, D2006, Oracle 10gR2, NET mode

zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

Post by zvasku » Thu 12 Apr 2007 13:01

In OCI mode all works ok. Prolem is in NET mode only.

Zdenek

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 12 Apr 2007 14:35

You should change the SQL property of the TSQLQuery component to the following:

Code: Select all

INSERT INTO TABLE(ID,DATA) VALUES (1, empty_blob())
RETURNING DATA INTO :DATAPAR
You should also replace the second parameter value that you are passing to the LoadFromStream method with ftOraBlob.

zvasku
Posts: 77
Joined: Tue 19 Sep 2006 12:04

Post by zvasku » Fri 13 Apr 2007 08:24

It works

Thanks
Zdenek

Post Reply