see in screenshot in url:
https://yadi.sk/i/mvPMiwyL3DCaXy
https://yadi.sk/i/mvPMiwyL3DCaXy
Code: Select all
procedure TForm2.btnInsertRecordClick(Sender: TObject);
var
  BlobField: TBlobField;
begin
  with TOpenDialog.Create(nil) do
  try
    MyQuery1.Close;
    MyQuery1.SQL.Clear;
    MyQuery1.SQL.Add('select id, name, file_blob1 from blob_table where id=:pID');
    MyQuery1.ParamByName('pID').AsInteger := 0;
    MyQuery1.Open;
    if Execute then
    begin
      MyQuery1.Append;
      MyQuery1.FieldByName('id').AsInteger := 1;
      MyQuery1.FieldByName('name').AsString := 'Test';
      BlobField := MyQuery1.FieldByName('file_blob1') as TBlobField;
      BlobField.LoadFromFile(FileName);
      MyQuery1.Post;
    end;
  finally
    Free;
  end;
end;
Code: Select all
mysql> show variables like "max_allowed_packet"
    -> ;
+--------------------+-----------+
| Variable_name      | Value     |
+--------------------+-----------+
| max_allowed_packet | 524288000 |
+--------------------+-----------+
Code: Select all
MySQL Table 
blob_table
ID:Int (10)
NAME:VARCHAR(200)
FILE_BLOB1: LONGBLOB