Dr. Dieter Becker writes:
> Sirs
>
> I want to save a binary information (eg. a picture ) in a special row of a
> database table. The data is in a file "bindata.bin" and should be loaded to
> a table. An "incorrect" insert would be:
> load data local infile 'bindata.bin' into table binbin (binfield) where
> binbin.id = "xxx"
>
> Is there any possibility to insert or load binary data into a special field
> and a selected row of the table.
>
> Thanks
>
> Dieter
>
Hi!
If you use 3.23, then do it with a command like this:
insert into binbin (binfield) values(load_file("/tmp/bindata.bin");
otherwise, if you use 3.22, you will have to use a program like this
one:
http://www.mysql.com/mysql++-examples.html
Regards,
Sinisa
+----------------------------------------------------------------------+
| ____ __ _____ _____ ___ == MySQL AB |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic |
| /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+----------------------------------------------------------------------+