Thank You very much,
but there rests a little question. How to insert this binary file in a
defined row? All other data are in this row, only the binary file must be
inserted?
Dieter
Dr. med. Dipl.-Math. Dieter Becker
Medizinische Universitäts- und Poliklinik
Innere Medizin III
D66421 Homburg
-----------------------------------------
Tel: 06841 16 3046 / -3077
Fax: 06841 16 3043 / -3385
Email: db@stripped
-----Original Message-----
From: sinisa@stripped [mailto:sinisa@stripped]
Sent: Tuesday, June 20, 2000 3:46 PM
To: db@stripped
Cc: mysql@stripped
Subject: Re: Storing BLOBs ??is it a faq?
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 |
+----------------------------------------------------------------------+