- changed milestone to 1.2
- removed version
Firedac Adapter must set Param Datatype if the Param value is unassigned
Issue #77
closed
When attempting to insert a record using FireDac, the Parameters must be typed otherwise Firedac fails with the following exception.
Thiis a one line fix to ensure that Firedac knows the parameter type of the value is unassigned.
Please add the following line to the TFireDacStatementAdapter.SetParam method in the Spring.Persistence.Adapters.FireDAC Unit.
procedure TFireDACStatementAdapter.SetParam(const param: TDBParam);
var
paramName: string;
begin
paramName := param.Name;
//strip leading : in param name because FireDAC does not like them
if (param.Name <> '') and StartsStr(':', param.Name) then
paramName := Copy(param.Name, 2, Length(param.Name));
{TFlora - If a param value is null then FD must know the type of the param,
so set the type into the parameter before setting the value}
Statement.Params.ParamByName(paramName).DataType := Param.ParamType; <--- This line needs to be added
Statement.Params.ParamValues[paramName] := param.Value;
end;
This issue is related to #76 which I have also updated with my fix code.
Comments (5)
-
repo owner -
- changed status to resolved
fixes
#76fixes#77SQL generators now responsible for creating TDBParams→ <<cset 76a9423afc6b>>
-
repo owner - changed status to closed
-
repo owner - changed milestone to 1.2 (next version)
-
repo owner - changed milestone to 1.2
- Log in to comment