I've got a problem with TClientDataset and update BLOBs. I have 2 table, orders and orders positions.
From the client I call a method on the server with following code below.
When I write to orders, everything is ok. When I call it a second time to update the orders position table, i get a Class error 'TLobLocator: Invalid handle'! What is that and how can I fix that?
Herbert
Code:
-----
procedure TSFRemoteDB.SetBlob(const TableName,Column,ID,sText: WideString);
var
LOB1: TLOBLocator;
begin
qryQuery.Close;
qryQuery.DeleteVariables;
qryQuery.SQL.Text := 'UPDATE ' + tablename +
' SET ' + column + ' = empty_blob() WHERE id = ''' + id +
''' returning ' + column + ' into :' + column;
qryQuery.DeclareVariable(column,otBlob);
LOB1 := TLOBLocator.Create(qryQuery.Session, otBLOB);
qryQuery.SetComplexVariable(column, LOB1);
qryQuery.ExecSQL;
LOB1.AsString := sText;
LOB1.Free;
From the client I call a method on the server with following code below.
When I write to orders, everything is ok. When I call it a second time to update the orders position table, i get a Class error 'TLobLocator: Invalid handle'! What is that and how can I fix that?
Herbert
Code:
-----
procedure TSFRemoteDB.SetBlob(const TableName,Column,ID,sText: WideString);
var
LOB1: TLOBLocator;
begin
qryQuery.Close;
qryQuery.DeleteVariables;
qryQuery.SQL.Text := 'UPDATE ' + tablename +
' SET ' + column + ' = empty_blob() WHERE id = ''' + id +
''' returning ' + column + ' into :' + column;
qryQuery.DeclareVariable(column,otBlob);
LOB1 := TLOBLocator.Create(qryQuery.Session, otBLOB);
qryQuery.SetComplexVariable(column, LOB1);
qryQuery.ExecSQL;
LOB1.AsString := sText;
LOB1.Free;