procedure TForm1.Button1Click(Sender: TObject);
var
Params: TFDParams;
Guid: TGUID;
begin
CreateGUID(
Guid);
try
Params := TFDParams.Create;
Params.Add('
guid',
Guid.ToString);
Params.Add('type', '123');
Params.Add('data', '{"value": "123"}');
Params.Add('inserted', Now);
Params.Add('processed', False);
Params.ParamByName('
guid').DataType := ftGuid;
Params.ParamByName('data').DataType := ftString;
// Params.ParamByName('data').DataType := ftBlob;
// Params.ParamByName('data').DataType := ftStream;
FDConnection1.ExecSQL('INSERT INTO events (
guid, type, data, inserted, processed)'
+ ' VALUES (:
guid, :type, :data, :inserted, :processed)', Params);
finally
Params.Free;
end;
end;