..Also found this in the Docs (perldoc DBI, search for binary)
Perl supports binary data in Perl strings, and the DBI will pass
binary
data to and from the driver without change. It is up to the
driver
implementors to decide how they wish to handle such binary data.
On Mon, 2004-05-10 at 14:33, Scott T. Hildreth wrote:
> I guess it would depend on which database you are using. I would try
> it with a bind column and let the DBD driver handle the quoting if need
> be,
>
> $dbh->do(q{
> update mystuff set binaryfld=?
> Where id=1
> }, undef, $binary_data
> );
>
> ..although you may have tell the driver that this is binary data,
> i.e binding a blob when using Oracle (ora_types)
>
> Probably not to much help, but maybe a start,
>
> STH
>
> On Mon, 2004-05-10 at 14:18, JupiterHost.Net wrote:
> > Anyone ever do this before?
> >
> > JupiterHost.Net wrote:
> >
> > > Hello DBI folks!
> > >
> > > If I have a column that is binary and data that is binary do I simply
> > > $dbh->quote() it on an insert?
> > >
> > > IE
> > >
> > > my $binary_content = get_binary_stuff();
> > >
> > > my $binary_content_Q = $dbh->quote($binary_content);
> > >
> > > $dbh->do("UPDATE MyStuff SET BinaryGoodies=$binary_content_Q WHERE ID=1");
> > >
> > > ...
> > >
> > > Or do I need to convert it to hex and then $dbh->quote() the hex
> > > version (or not quote it)?
> > >
> > > If I do need to make it hex first do I need to "unhex" it, after I
> > > SELECT it into a variable, to get it into the original binary format?
> > >
> > > (w/ pack()/unpack()??? which is a bit OT for this list...)
> > >
> > > TIA
> > >
> > > Lee.M - JupiterHost.Net
> > >
> > >
> > >