Board index » delphi » inserting images via sql insert query

inserting images via sql insert query

Hi
I am having a peculier problem. I am using the structure where in I pass sql insert query to Object as parameter which in tern call sql insert on interbase.
Now I want to store Image(*.ico) files as Blob. Is it possible to insert BLOB field value as a part of insert query?
How to tackle this problem.

Mandar

 

Re:inserting images via sql insert query


Quote
Mandar wrote:
> Hi
> I am having a peculier problem. I am using the structure where in I
> pass sql insert query to Object as parameter which in tern call sql
> insert on interbase. Now I want to store Image(*.ico) files as Blob.
> Is it possible to insert BLOB field value as a part of insert query?
> How to tackle this problem.

> Mandar

You must use parametrized sql and pass your file as parameter.

--
Bojidar Alexanrov
Kodar Ltd.
http://www.Kodar.net

Re:inserting images via sql insert query


Try this:

          qryIns->ParamByName("binary_file")->LoadFromFile(file_path,
ftBlob);
          qryIns->ExecSQL();

Jarek

Other Threads