[ale] Append to the data in a BLOB in MySQL

cfowler cfowler at outpostsentinel.com
Wed Jan 31 10:34:37 EST 2007


Error message:
ERROR 1093 (HY000): You can't specify target table 'file' for update in
FROM clause

On Tue, 2007-01-30 at 22:52 -0500, Christopher Fowler wrote:
> I'm trying to append data to a blob in MySQL.  Normally I would do it
> like this:
> 
> select content from file where file_id=?
> content .= extra
> update file set content = content where file_id=?
> 
> Now this can get slower and slower as the content gets bigger.
> 
> Is there a way I can simply append to the data?
> 
> I tried this:
> 
> update file set content=concat((select content from file where
> file_id=?), extra) where file_id=?
> 
> MySQL gave me an error message on that one.
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale




More information about the Ale mailing list