[freetds] Procedure or function has too many arguments specified

Man Min Yan manmin_yan at yahoo.com.au
Thu Oct 16 22:25:27 EDT 2008


Hi,
I am getting the above error when trying to execute over 65535 statements (tested with insert, update and select) using DBD::ODBC, unixODBC and freeTDS (both 0.82 stable and 0.83 20081016) talking to SQL Server 2000 and 2005. I can consistently replicate the problem with the script below.

Please note:
- my freetds.conf is configured with 'tds version = 8.0'
- I'm running on f7, with unixODBC 2.2.12-5, DBD::ODBC 1.13
- the script runs fine if I use DBD::ODBC, unixODBC, mysql-connector (sorts of eliminates DBD::ODBC, unixODBC as the culprits)
- the script runs fine if I use DBD::Proxy (eliminates the dbms side as the culprit)
- the script only fails if there is a prepared select present (even if never used).
- it always fails on record 65536 (16-bit number somewhere??)
- I've attached an extract of the freetds dump log for the last couple of records.

Any help in solving this problem would be greatly appreciated. Thanks.
---
#!/usr/local/bin/perl -w

use strict;
use DBI;

# The table 'test_table' has the following structure
#    create table test_table (id int not null, value varchar(10))

my $dsn = 'dbi:ODBC:sqlserver'; my $user='xx'; my $pass='xx';
#my $dsn = 'dbi:ODBC:mysql'; my $user='xx'; my $pass='xx';
#my $dsn = 'dbi:Proxy:hostname=myserver;port=40000;dsn=dbi:ODBC:sqlserver'; my $user='xx'; my $pass='xx';
my $dbh = DBI->connect($dsn, $user, $pass,
    {
        PrintError => 0,
        RaiseError => 0,
        AutoCommit => 1,
    }) or die $DBI::errstr;
$dbh->do('truncate table test_table') or die $dbh->errstr;

#my $updSth = $dbh->prepare('update test_table set value=? where id=?') or die $dbh->errstr;
my $selSth = $dbh->prepare('select * from test_table where id=?') or die $dbh->errstr;
my $insSth = $dbh->prepare('insert into test_table values (?, ?)') or die $dbh->errstr;

$| = 1;
my $maxIteration = 100000;
for (my $i = 1; $i <= $maxIteration; $i++)
{
    print "$i\r";
    $insSth->execute($i, $i) or die "Fail execute with $i - ", $insSth->errstr;
    #$updSth->execute('v' . $i, $i) or die "Fail execute with $i - ", $updSth->errstr;
    #$selSth->execute($i) or die "Fail execute with $i - ", $selSth->errstr;
    #$selSth->finish();
}


Send instant messages to your online friends http://au.messenger.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump.log.gz
Type: application/x-gzip
Size: 3018 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20081016/23788974/attachment.bin 


More information about the FreeTDS mailing list