On 3/29/01 3:37 AM, "Darius Ivanauskas" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> Does anybody know, how to insert large amount of data
> (ex.: large binary files) into BLOB columns?
> 
> Thanks,
> Darius Ivanauskas
> 
> P.S. Please reply to me.
> 
> 

The general algorithm is:

Open binary file
Check filesize (to make sure it will fit within the blob size constraint in
the column you created for it)
Slurp contents into variable ($blobfile if I were in PHP or Perl)
Insert data into database, inserting contents of the $blobfile into the
query.
Ie. INSERT INTO mytable (blobfield,recid) VALUES ('blobfield','$recid')

I don't know how you would do it from the command line the mysql client
though.

Maybe it would be "LOAD DATA LOCAL INFILE blobfile INTO TABLE mytable
(blobfield);"

That one is purely a guess though. The only times I have done it, have been
within a program or script, using the variable method.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to