Hi I made some test on my machine (i386, suse 7.2, sapdb 7.3.0.18) regarding this problems.
I had no problems with C and ODBC (you will find the code attached)
but with perl I get the Error
SQLError: (-904) Space for result tables exhausted at
/usr/lib/perl5/site_perl/5.6.0/SAP/DBTech/sapdb.pm line 265.
after 1952 selects, even when there is data, but I didn't fetch the rows as in
the other examples. Please note that I did not use the ODBC driver but the
module SAP::DBTech::sapdb.
I stopped the C program after more than 100000 selects. Everything perfect. I like C ;)
Regards,
Axel
*******************************************************************************
Perl Code:
*******************************************************************************
#!/usr/bin/perl
use SAP::DBTech::sapdb;
use strict;
my $user = "DBA";
my $pwd = "DBA";
my $dbname = "TST";
my $host="mojito";
my $dbh;
#could not get DBD::ODBC running :(
#use DBI;
#
#$dbh=DBI->connect('dbi:ODBC:TST', 'DBA', 'DBA');
#$dbh->do("create table TESTA (ID INTEGER NOT NULL, PRIMARY KEY(ID))");
#$dbh->do("insert into TESTA (ID) VALUES (1)");
#while (1)
#{
# $x=$dbh->selectall_arrayref("select ID from TESTA where ID=1");
#}
# connect to db
eval {
$dbh = sapdb::connect ($user, $pwd, $dbname, $host);
};
if(defined $dbh) {
my $sql="create table TESTA (ID INTEGER NOT NULL, PRIMARY KEY(ID))";
my $prepared=$dbh->prepare($sql);
print "prepared..\n";
$prepared->execute();
$sql=("insert into TESTA (ID) VALUES (1)");
$prepared=$dbh->prepare($sql);
$prepared->execute();
print "inserted..\n";
my $i=0;
while (1)
{
$i++;
my $stat=("select ID from TESTA where ID=1");
#my $x=$dbh->selectall_arrayref("select ID from TESTA where ID=1");
my $x=$dbh->sql($stat);
print "$i\n";
}
}else{
print "\nerror=$@\nno connection to database \"$dbname\"\n\n";
}
exit(0);
*******************************************************************************
C Code:
*******************************************************************************
attached ;)
testselects.cpp
Description: Binary data
