Home > Back-end >  Sqlite database, I want to use the insert into statement is inserted into the blob field recorded da
Sqlite database, I want to use the insert into statement is inserted into the blob field recorded da

Time:11-09

Such as:
Sqlite database, I want to use the insert into statement is inserted into the blob field recorded data, please help, for example:
For example: insert into table1 (id, fieldBlob) values (1,?)
Sqlite3_bind_blob next will not write, if need to use, and so on function, ask everybody to help me

CodePudding user response:

If (trim (edit1. Text) & lt;> ") and (not image1. Picture. Graphic. The empty) then
The begin
With adoquery1 do
The begin
SQL. The Clear;
SQL. The Add (' insert into PIC values (: a: b) ');
Adoquery1. The Parameters [0]. Value:=edit1. Text;
Adoquery1. The Parameters [1]. The Assign (image1. Picture. Graphic);
//adoquery1. The Parameters [1]. LoadFromStream (tmpstream); Two ways can, MSSQL sure no problem
ExecSQL;
SQL. The Clear;
SQL. The Add (' select * from PIC);
Open
end;
end;

CodePudding user response:

 
Adoquery1. The Parameters [1]. The DataType=ftBlob;
Adoquery1. The Parameters [1]. LoadFromStream (Stream, ftBlob);

CodePudding user response:

For reference only
With ADOQueryTemp do
The begin
The Close;
SQL. The Clear;
SQL. The Add (' update T_Consumption_Detail_Temp ');
SQL. The Add (' set Associated_ID='1' ' ');
SQL. The Add (' where bill_id=: bill_id ');
The parameters. Parambyname (' bill_id). The Value:='XXX';
ExecSQL;
end;
ADOQueryTemp. Close;
ADOQueryTemp. Open;
  • Related