Skip to Content.
Sympa Menu

freetds - Re: [freetds] Translation of strings/literals to varbinary?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Peter C. Norton" <spacey-freetds.org AT ssr.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Translation of strings/literals to varbinary?
  • Date: Mon, 6 Dec 2010 18:41:10 -0500

I should mention that I'm testing this against SQL Server 2008r2. I
would like to test this on sybase as well, but my prior problems with
connecting to Sybase ASE 15 with DBD::ODBC still stand.

-Peter

On Mon, Dec 06, 2010 at 06:38:07PM -0500, Peter C. Norton wrote:
> I'm wondering if there is any documentation on the expected behavior
> when a prepared statement is passed a representation of a varbinary?
> I'm asking because when using perl's DBD::Sybase linked to the sybase
> ctlib, I can set up the following prepared statement:
>
> my $sth = $dbh->prepare("SELECT foo_varbinary from db..mapped_value_map
> WHERE thing_id = ?");
>
> I can then do the following, all of which return identical rows:
> my $vbinary = "00038600be24829d";
> $sth->execute(pack('H*', $vbinary);
> or
> $sth->exeute($vbinary);
> or
> $sth->execute("0x" . $vbinary);
>
> However, when using DBD::ODBC via FreeTDS, only the first
> representation of the varbinary works. Is this something that
> *should* work? Or is the failure of the 2nd and 3rd forms an
> oversight? Is there any documentation on what values/representations
> should be posible for doing this?
>
> Thanks,
>
> -Peter
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page