freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: David Blackstone <abcs.dblackstone AT gmail.com>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] DBD::Sybase: ct_send_data example fails
- Date: Thu, 22 Jan 2009 18:50:04 +0000
I am trying to post data to an NTEXT field in MSSQL Server with
DBD::Sybase, using the example from the documentation. Here is my
code:
my $sql = <<"EOF";
SELECT thenote
FROM Notes
WHERE notes_id = ?
EOF
my $sth = $dbh->prepare($sql);
$sth->execute($notes_id);
while ($sth->fetch)
{
$sth->syb_ct_data_info('CS_GET', 1);
}
$sth->syb_ct_prepare_send;
$sth->syb_ct_data_info('CS_SET', 1,
{total_txtlen => length $text,
log_on_update => 1});
$sth->syb_ct_send_data($text, length $text);
$sth->syb_ct_finish_send;
This is more or less copied straight out of the docs. Unfortunately,
when I hit the ct_send_data line, I get this error:
DBD::Sybase::st syb_ct_send_data failed: Server message number=102
severity=15 state=1 line=1 server=SQL_SERVER_TEST text=Incorrect
syntax near '0x00000000000000000000000000000000'.
Server message number=319 severity=15 state=1 line=1
server=SQL_SERVER_TEST text=Incorrect syntax near the keyword 'with'.
If this statement is a common table expression or an xmlnamespaces
clause, the previous statement must be terminated with a semicolon.
I turned on FreeTDS logging, and I see this in the logs:
write.c:134:tds_put_string converting 90 bytes of "writetext bulk
0x00000000000000000000000000000000 timestamp = 0x0000000000000000 with
log"
It would seem that I am coming up against the same error described here:
https://lists.ibiblio.org/sympa/arc/freetds/2005q1/018014.html
https://lists.ibiblio.org/sympa/arc/freetds/2005q1/018015.html
https://lists.ibiblio.org/sympa/arc/freetds/2005q1/018017.html
Apparently in that discussion it was discovered that DBD::Sybase was
not setting all the values it needed to set in its call to
ct_send_data. Has this been fixed? Is there any workaround? Has
anyone ever gotten the example in the documentation to work?
- [freetds] DBD::Sybase: ct_send_data example fails, David Blackstone, 01/22/2009
Archive powered by MHonArc 2.6.24.