Unix Technical Forum

newbie blob LOAD_FILE issue

This is a discussion on newbie blob LOAD_FILE issue within the MySQL forums, part of the Database Server Software category; --> Hi All, I am new to this list as well as MySQL in general. I am trying to insert ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 10:29 AM
nevin
 
Posts: n/a
Default newbie blob LOAD_FILE issue

Hi All,

I am new to this list as well as MySQL in general. I am trying to
insert a blob file into a simple table. the table has 4 variables
(name, age,al,ne) and ne is defined as a mediumblob field. I am using
heidiSQL as a gui for writing this code. here is the code i am using


INSERT into nevin (name,age,al,ne)
VALUES ('Abe',38,2,LOAD_FILE ('c:/program files/MySQL/MySQL Server
5.0/data/7184_thumb.jpg');

when i run it i get an error stating. SQL Error: You have an error in
your SQL syntax.

Can anyone see what is wrong with this code? Thanks in advance for
your assistance!!

--nevin

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:29 AM
Paul Lautman
 
Posts: n/a
Default Re: newbie blob LOAD_FILE issue

nevin wrote:
> Hi All,
>
> I am new to this list as well as MySQL in general. I am trying to
> insert a blob file into a simple table. the table has 4 variables
> (name, age,al,ne) and ne is defined as a mediumblob field. I am using
> heidiSQL as a gui for writing this code. here is the code i am using
>
>
> INSERT into nevin (name,age,al,ne)
> VALUES ('Abe',38,2,LOAD_FILE ('c:/program files/MySQL/MySQL Server
> 5.0/data/7184_thumb.jpg');
>
> when i run it i get an error stating. SQL Error: You have an error in
> your SQL syntax.

Is that really all the error message says? It usually gives more information
pointing to where the error is.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 10:29 AM
nevin
 
Posts: n/a
Default Re: newbie blob LOAD_FILE issue

Sorry missed that. the entire error says :

SQL Error: You have an error in your SQL syntax: check the manual that
corresponds to your mySQL server version for the right syntax to use
near " at line 2

--I am using MySQL 5.

One other point ..when i add another closing ) at the end of the load
file statement such as:
LOAD_FILE ('c;/program files/MySQL/MySQL Server 5.0/data/
7184_thumb.jpg'));

I get a different error saying: SQL error: FUNCTION art.LOAD_FILE does
not exist.

Thanks!!
nevin


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 10:29 AM
nevin
 
Posts: n/a
Default Re: newbie blob LOAD_FILE issue

Hi All,

I solved it!! simple mistake really all i needed to do was add the
extra ) at the end of the load_file statement,
and the clincher was that there was an extra space in my original code
between LOAD_FILE and the opening (
when i removed this space, it worked!! here is the working code.

INSERT into nevin (name,age,al,ne)
VALUES ('JAMES',38,2,LOAD_FILE('c:/program files/MySQL/MySQL
Server 5.0/data/7184_thumb.jpg'));

thanks !

--nevin

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com