Page 1 of 1

BLOB and insert command

Posted: Thu 12 Apr 2007 12:26
by zvasku
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

Posted: Thu 12 Apr 2007 13:01
by zvasku
In OCI mode all works ok. Prolem is in NET mode only.

Zdenek

Posted: Thu 12 Apr 2007 14:35
by Plash
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.

Posted: Fri 13 Apr 2007 08:24
by zvasku
It works

Thanks
Zdenek