I have found LOAD_FILE has to be used in an update statement. So to insert a row that includes a blob such as your example you would have the following two statements:
INSERT INTO blobtest (name ) VALUES ( '1'); followed by: UPDATE blobtest SET myblob = LOAD_FILE('/root/.profile') WHERE name = '1'; I have been able to corrupt a datafileconsistently doing this interactively with the server. The disk that the datafile was on ran out of space. So you might want to check the robustness of your situation and plan accordingly. -Grady ----- Original Message ----- From: "Victoria Reznichenko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 18, 2002 12:40 PM Subject: Re: SELECT from blob column > Joćo, > Thursday, April 18, 2002, 5:16:26 PM, you wrote: > > JPV> I know it has been covered before. I read the manual, I folow the examples, > JPV> and I am still having problems. What I want is store a blob in a blob field, > JPV> so: > > JPV> CREATE TABLE blobtest ( name CHAR(5), myblob MEDIUMBLOB ); > JPV> Query Ok. > > JPV> INSERT INTO blobtest VALUES ( '1', LOAD_FILE('/root/.profile') ); > JPV> Query Ok, 1 row affected. > > JPV> SELECT * FROM blobtest; > JPV> +-------+---------------------+ > JPV> | Name | myblob | > JPV> +-------+---------------------+ > JPV> | 1 | NULL | > JPV> +------+----------------------+ > > JPV> I've tried LOAD_FILE with many other files, including files in world-readable > JPV> directories, and I always get the same result. > > JPV> Am I missing something ? > > Check your permissions on files, that you want to insert into BLOB > field and dirs that contain those files. > > > > > -- > For technical support contracts, goto https://order.mysql.com/ > This email is sponsored by Ensita.net http://www.ensita.net/ > __ ___ ___ ____ __ > / |/ /_ __/ __/ __ \/ / Victoria Reznichenko > / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] > /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net > <___/ www.mysql.com > > > > > --------------------------------------------------------------------- > 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 > > --------------------------------------------------------------------- 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