in reply to DBI and binary data type
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$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();
returns 0x3078303242453842 and not 0x02BE8B003DB14301. how can i insert this binary number? thanks, Michaeldeclare @var varchar(8) set @var='0x02BE8B003DB14301' select convert(binary(8), @var)
|
|---|