thanks for your response juerd and mpeppler.
i'm using DBD::ODBC.
The unpack worked very nicely, but this leads me
to another problem--how
to perform an insert into a binary column with this retrieved binary number.
i'm trying like this:
$ctsth = $ctdbh->prepare( "INSERT INTO table(ParentID,ChildID) VALUES
+(?,?)" );
$ctsth->bind_param( 1, $hexform1, {TYPE => SQL_BINARY} );
$ctsth->bind_param( 2, $hexform2, {TYPE => SQL_BINARY} );
$ctsth->execute();
but the server keeps telling me that it can't
implicitly convert a varchar to a binary and to
use the SQL CONVERT function.
i've tried using the CONVERT function in query analyzer and
it gives me strange results
declare @var varchar(8)
set @var='0x02BE8B003DB14301'
select convert(binary(8), @var)
returns 0x3078303242453842 and not 0x02BE8B003DB14301.
how can i insert this binary number?
thanks, Michael |