I guess what he meant is how to save the content
of a text file into a mySQL blob. The only way
I find out is to issue an INSERT VALUES query
with the file content being a huge string literal.
Of course this puts up a limit on the packet size.
So if you have large files, you have to save it across
several rows instead of one blob.
-----Original Message-----
From: Sasha Pachev [mailto:sasha@stripped]
Sent: Thursday, July 08, 1999 1:38 PM
To: DJs Disc
Cc: mysql@stripped
Subject: Re: Blobs
DJs Disc wrote:
>
> I've run out of places to try to find out how to
> place a pointer to a file into a BLOB field. The
> closest info so far is that one uses (X'....') and
> types in the entire binary file while escaping all
> special chrs like single quotes and nulls.
>
> Disclaimer #1: I'm new to MySQL, although not to
> programming, so I'm scrambling on this project.
>
> Disclaimer #2: In the event this subject has already
> been beaten to death here, how do I pick up old
> threads for this list? (To try to avoid flames.)
>
Why a pointer to a file, and what kind of pointer are you talking about?
The best pointer to a file I am aware of is the full path to it, which
you can insert quite nicely most of the time without escaping anything.
If you really want to escape, use mysql_escape_string() in C or
DBI->quote() in Perl
--
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail mysql-thread6870@stripped
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail mysql-unsubscribe@stripped instead.
| Thread |
|---|
| • Blobs | DJs Disc | 9 Jul |
| • Re: Blobs | Sasha Pachev | 9 Jul |
| • RE: Blobs | Exchange) | 9 Jul |