I have a Stored Procedure on my MySQL Database with 2 Blob parameters as OUT Parameter
I want to get their values as TStream, I have tried this code for test :
Code: Select all
SP := TUniStoredProc.Create(nil);
M := TMemoryStream.Create;
try
SP.StoredProcName := 'user_getpic';
SP.PrepareSQL(False);
try
SP.Params.ParamByName('fUID').AsString := '';
SP.Params.ParamByName('fDiceCode').AsString := '00010052';
...
SP.ExecProc;
M.LoadFromStream(SP.Params.ParamByName('fUPic').AsStream);
except
on E:EXception do
begin
ShowMessage('Error : ' + E.Message);
end;
end;
finally
SP.Free;
M.Free;
end
There is an AV on LoadFromStream of M because the Param.AsStream returns Nil but Param.AsBlob is not Nil
When I Call this SP on MySQL directly fUPic have blob data and there is no problem on SP
I have tried SP.CreateBlobStream() but what I should pass to it`s first parameter as TField ?!
I want to know how I can get an OUT blob parameter as TStream ?
I`m using Delphi XE6 and UniDAC 6.1.4
thanks