List:General Discussion« Previous MessageNext Message »
From:kayamboo Date:September 27 2002 5:05am
Subject:Re: Updating blob from command line
View as plain text  
Hi Ivan
Make sure that you have the image in the path you have specified.
I checked it mysel and below are the results.
Even if the size exceeds, a truncated data should be there.
So it is evident, you are doing wrong with your path or the image is not
there.


mysql> create table tblob( title varchar(100) null, pic mediumblob nul
Query OK, 0 rows affected (0.00 sec)

mysql> desc tblob ;
+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| title | varchar(100) | YES  |     | NULL    |       |
| pic   | mediumblob   | YES  |     | NULL    |       |
+-------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> insert into tblob values('Test',
load_file('e:/mysql/images/Click.gif'));
Query OK, 1 row affected (0.00 sec)

mysql> select * from tblob ;
+-------+-------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
------------+
| title | pic



                                                                          |
+-------+-------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
------------+
| Test  |GIF89ak |
+-------+-------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------
----------------------------------------------------------------------------
------------+
1 row in set (0.00 sec)

mysql>
mysql> select length(pic) from tblob where title = 'Test' ;
+-------------+
| length(pic) |
+-------------+
|        2237 |
+-------------+
1 row in set (0.00 sec)


regards
----- Original Message -----
From: "Ivan Paul" <ivan@stripped>
To: "kayamboo" <kayamboosuresh@stripped>
Cc: "MySQL" <mysql@stripped>
Sent: Friday, September 27, 2002 1:14 PM
Subject: Re: Updating blob from command line


> dear kayamboo,
>
> i've tried it, but seems there still something strange with this matter,
so
> i decided to create one table with myisam table type (default table type),
> and i try to input data in this table. but when i check this up (do query)
i
> have null value in mediumblob field (pic).
>
> this is the captured process...
>
> Logging to file 'c:\mysql\problem.txt'
> mysql> create table tblob
>     -> (
>     -> title varchar(100) null,
>     -> pic mediumblob null
>     -> );
> Query OK, 0 rows affected (0.06 sec)
>
> mysql> desc tblob;
> +-------+--------------+------+-----+---------+-------+
> | Field | Type         | Null | Key | Default | Extra |
> +-------+--------------+------+-----+---------+-------+
> | title | varchar(100) | YES  |     | NULL    |       |
> | pic   | mediumblob   | YES  |     | NULL    |       |
> +-------+--------------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> mysql> insert into tblob
>     -> values('Test', load_file('c:/mysql/betasw.gif'));
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select * from tblob;
> +-------+------+
> | title | pic  |
> +-------+------+
> | Test  | NULL |
> +-------+------+
> 1 row in set (0.00 sec)
>
> mysql> \t
>
>
> TIA,
>
> Ivan Paul
>
> sql, query
>

Thread
Fw: Updating blob from command linekayamboo26 Sep
  • Re: Updating blob from command linekayamboo26 Sep
  • Re: Updating blob from command linekayamboo26 Sep
  • Re: Updating blob from command lineIvan Paul27 Sep
  • Re: Updating blob from command linekayamboo27 Sep