Looks like a bug in TMyScript.
I'm not able to use parameters like in TMyQuery component !
Here is my SQL Script
Code: Select all
Update
ClientsSIA
Set
IdVRP = :prIdVRP,
IdVRPInitial = If(IfNull(IdVRPInitial,'') = '', :prIdVRP, IdVRPInitial)
Where
IdClientSIA in
(&ListeClients)
This code gives an error out of index (when calling Params[0] or Params[1] :
Code: Select all
scMAJIdVRPClientSIA.Connection.StartTransaction;
try
scMAJIdVRPClientSIA.Params[0].AsString := qrVRP.FieldByName('IdVRP').AsString;
scMAJIdVRPClientSIA.Params[1].AsString := qrVRP.FieldByName('IdVRP').AsString;
scMAJIdVRPClientSIA.Macros.MacroByName('ListeClients').Value := ListeClients;
scMAJIdVRPClientSIA.Execute;
scMAJIdVRPClientSIA.Connection.commit;
except
scMAJIdVRPClientSIA.Connection.Rollback;
raise;
end;
This code gives an error out unknown parameter (when calling ParambyName(pridvrp).Astring :
Code: Select all
scMAJIdVRPClientSIA.Connection.StartTransaction;
try
scMAJIdVRPClientSIA.Params.ParambyName('prIdVRP').AsString := qrVRP.FieldByName('IdVRP').AsString;
scMAJIdVRPClientSIA.Macros.MacroByName('ListeClients').Value := ListeClients;
scMAJIdVRPClientSIA.Execute;
scMAJIdVRPClientSIA.Connection.commit;
except
scMAJIdVRPClientSIA.Connection.Rollback;
raise;
end;