Hello,
I'm trying to save a blobstream using tsqlquery.
After executing the query, everything looks fine so far, but for files > 1kb the blob field is empty.
The fieldtype in my database is BLOB.
My code looks like:
FQry.SQL.Add('UPDATE tbl_dbtool_doc SET blbFileBlob = :Blob WHERE intId_pk = 6');
FQry.ParamByName('Blob').LoadFromStream(AStream, ftBlob);
FQry.ExecSQL;
I've also tried to set
FQry.ParamByName('Blob').ParamType := ptOutput;
FQry.ParamByName('Blob').DataType := ftOraBlob;
but then I get an access vialoation in dbexpoda40.dll (v 4.2).
Thanks for your help
Sebastian
problem saving blob field with tsqlquery
You need to use the ftOraBlob data type and SQL statement with RETURNING clause. You should also pass ftOraClob to the LoadFromStream method.
Code: Select all
FQry.SQL.Add('UPDATE tbl_dbtool_doc SET blbFileBlob = empty_blob() ' +
'WHERE intId_pk = 6 RETURNING blbFileBlob INTO :Blob');
FQry.ParamByName('Blob').ParamType := ptInput;
FQry.ParamByName('Blob').DataType := ftOraBlob;
FQry.ParamByName('Blob').LoadFromStream(AStream, ftOraBlob);
FQry.ExecSQL;
Hi Plash,
thanks for your reply. Your sample code works out of the box. However I get an access violation in dbexpoda40.dll after executing the statement. (TDBXError : Access vialotation at address 04A53FD5 in module "dbexpoda40.dll).
The blob is filled correctly and the exeption occures only in debug mode. It's ok, but not perfect. Any ideas?
best regards
Sebastian
thanks for your reply. Your sample code works out of the box. However I get an access violation in dbexpoda40.dll after executing the statement. (TDBXError : Access vialotation at address 04A53FD5 in module "dbexpoda40.dll).
The blob is filled correctly and the exeption occures only in debug mode. It's ok, but not perfect. Any ideas?
best regards
Sebastian