[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Append to the data in a BLOB in MySQL
- Subject: [ale] Append to the data in a BLOB in MySQL
- From: cfowler at outpostsentinel.com (cfowler)
- Date: Wed, 31 Jan 2007 10:34:37 -0500
- In-reply-to: <[email protected]>
- References: <[email protected]>
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