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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.