|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|