Hi Thomas, you have found a bug in DBD::MaxDB. The flag that the resultset is empty wasn't reset after the first execute of sth2. So the second execute also returns no result. You can fix it when you apply the following patch to dbdimp.c
@@ -1372,10 +1372,11 @@ if (! dbd_maxdb_sqldbc_bind_parameters (sth, imp_sth)){ DBD_MAXDB_METHOD_RETURN(imp_sth, dbd_maxdb_st_execute, DBD_MAXDB_ERROR_RETVAL); } exec_rc = SQLDBC_PreparedStatement_executeASCII (imp_sth->m_prepstmt); -> imp_sth->m_rowNotFound= SQLDBC_FALSE; if ( exec_rc != SQLDBC_OK && exec_rc != SQLDBC_NO_DATA_FOUND) { dbd_maxdb_sqldbc_error(sth, SQLDBC_PreparedStatement_getError(imp_sth->m_prepstmt)) ; DBD_MAXDB_METHOD_RETURN(imp_sth, dbd_maxdb_st_execute, DBD_MAXDB_ERROR_RETVAL); } I will also upload a patch to CPAN. Thank you for reporting this bug. Regards, Marco SAP Labs Berlin > -----Original Message----- > From: Thomas Zake [mailto:[EMAIL PROTECTED] > Sent: Montag, 26. September 2005 23:04 > To: maxdb@lists.mysql.com > Subject: DBD::MaxDB - Problem with empty result set > > Hi, > > assume, we have the two tables T1 and T2: > CREATE TABLE T1 ( K1 VARCHAR(3), PRIMARY KEY (K1) ) > CREATE TABLE T2 ( K1 VARCHAR(3), K2 VARCHAR(3), PRIMARY KEY ( > K1, K2 ) ) > > with the following contents: > T1: K1 T2: K1 | K2 > ----- ----------------- > 001 002 | 001 > 002 > > and the following script: > > #!/usr/bin/perl > > use strict; > use warnings; > use DBI; > > my $dbh = DBI->connect("dbi:MaxDB:....",...); > > my $sth1 = $dbh->prepare("Select k1 From t1"); > my $sth2 = $dbh->prepare("Select k2 From t2 Where k1 = ?"); > $sth1->execute; > while ( my ( $k1 ) = $sth1->fetchrow_array ) { > print ">T1 - $k1\n"; > $sth2->execute( $k1 ); > while ( my ( $k2 ) = $sth2->fetchrow_array ) { > print ">>>T2 - $k1 $k2\n"; > } > } > $sth1->finish; > $sth2->finish; > $dbh->disconnect; > > The Result is: > >T1 - 001 > >T1 - 002 > > and not as expected: > >T1 - 001 > >T1 - 002 > >>>T2 - 001 002 > > After the first execute of $sth2 with an empty result set, > the result set of > $sth2 is always empty. > > Used with DBD::MaxDB 7.6.00.16a with SQLDBC 7.6.00.12 on SuSE > 9.3 with MaxDB > 7.5.21 > > Any ideas? > > Kind regards > Thomas > > > > -- > MaxDB Discussion Mailing List > For list archives: http://lists.mysql.com/maxdb > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > > -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]