Our codes worked fine fine until the recent version (8.4.1), but now we receive a "Lob locator should be inited." error when a storedproc contains a BLOB/CLOB param.
I found this:
TOracleUniProvider.CreateDataSetOptions >
FDataSetOptions.Add(TBooleanOption.Create('TemporaryLobUpdate', prTemporaryLobUpdate, [TOCICommand], False));
This value was True in the previous version.
Here is what your documantation says:
TemporaryLobUpdate - Enables the use of a temporary LOB to write input and input/output LOB parameter into database when executing dataset's SQL statements. The default value is True.
https://www.devart.com/unidac/docs/using-oracle.htm
You can reproduce the problem whith the following code:
Oracle:
Code: Select all
create or replace function DEMO_PROC(i_file IN BLOB)
return number
as
BEGIN
return 0;
END;
Code: Select all
TfrmMain = class(TForm)
conMain: TUniConnection;
trMain: TUniTransaction;
spDemo: TUniStoredProc;
procedure FormCreate(Sender: TObject);
private
public
end;
...
procedure TfrmMain.FormCreate(Sender: TObject);
var
xStream: TMemoryStream;
begin
conMain.Connect;
spDemo.Prepare;
xStream := TMemoryStream.Create;
try
xStream.Clear;
xStream.LoadFromFile('c:\any_file.txt');
spDemo.ParamByName('i_file').LoadFromStream(xStream, ftOraBlob);
finally
FreeAndNil(xStream);
end;
spDemo.Execute;
end;