PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > newbie blob LOAD_FILE issue
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
newbie blob LOAD_FILE issue

Réponse
 
LinkBack Outils de la discussion
Vieux 02/11/2007, 17h07   #1
nevin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Vieux 02/11/2007, 22h01   #2
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.


  Réponse avec citation
Vieux 02/11/2007, 23h19   #3
nevin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Vieux 02/11/2007, 23h46   #4
nevin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 21h38.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09352 seconds with 12 queries