[freetds] FreeTDS, DBD::Sybase, MS SQL Server and multiple result sets

Simon Matthews sam at knowledgepool.com
Thu Sep 21 03:12:29 EDT 2006


Michael,
       thanks for the tip.  For the record, I now have the above
combination working.  One thing that did confuse me is that the tests in
DBD::Sybase for multiple result sets fail on MS SQL server.  It would
appear that the queries rely on Sybase specific system procedures.
Would it be better to switch them to generic queries that just return
fixed values?  This way the tests could be portable.

Thanks again for the guidance.

Regards

sam



> -----Original Message-----
> From: michael.peppler at bnpparibas.com 
> [mailto:michael.peppler at bnpparibas.com] 
> Sent: 12 September 2006 06:43
> To: freetds at lists.ibiblio.org
> Subject: Re: [freetds] FreeTDS, DBD::Sybase, MS SQL Server 
> and multiple result sets
> 
> 
> DBD::Sybase supports multiple result sets. If you check the 
> DBD::Sybase man page you'll see a couple of examples. The 
> general idea is to code your fetch loop like this:
> 
> $sth = $dbh->prepare(...);
> $sth->execute;
> 
> REDO: {
>     while($row = $sth->fetch) {
>             ....
>     }
>     redo REDO if $sth->{syb_more_results};
> };
> 
> Michael
> 
> 
> 
> 
> Internet
> sam at knowledgepool.com@lists.ibiblio.org - 09/09/2006 23:24
> 
> 
> Please respond to freetds at lists.ibiblio.org
> 
> Sent by:    freetds-bounces at lists.ibiblio.org
> 
> To:    freetds
> 
> cc:
> 
> 
> Subject:    [freetds] FreeTDS, DBD::Sybase,     MS SQL Server 
> and multiple
>        result sets
> 
> 
> I have been using the above combination for a couple of years 
> quite successfully.
> 
> I now need to be able to process more than one result set 
> from a stored procedure.
> 
> Can anyone confirm if they have been able to use DBD::Sybase 
> with MS-SQL server 2000 and have any success with multiple 
> result sets?
> 
> I can see that they work in tsql.  I have a stored procedure 
> that returns multiple result sets and I can see these results 
> in tsql.  I have not been able to read anything other than 
> the first result set with DBD::Sybase.
> 
> I am just looking for a quick yes that should work, or no if 
> definitely won't in which case I can stop banging my head 
> against this particular brick wall.
> 
> 
> Thanks
> 
> sam
> 
> 
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org  
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 
> 
> 
> This message and any attachments (the "message") is
> intended solely for the addressees and is confidential. 
> If you receive this message in error, please delete it and 
> immediately notify the sender. Any use not in accord with 
> its purpose, any dissemination or disclosure, either whole 
> or partial, is prohibited except formal approval. The 
> internet can not guarantee the integrity of this message. 
> BNP PARIBAS (and its subsidiaries) shall (will) not 
> therefore be liable for the message if modified. 
> 
>                 ---------------------------------------------
> 
> Ce message et toutes les pieces jointes (ci-apres le 
> "message") sont etablis a l'intention exclusive de ses 
> destinataires et sont confidentiels. Si vous recevez ce 
> message par erreur, merci de le detruire et d'en avertir 
> immediatement l'expediteur. Toute utilisation de ce 
> message non conforme a sa destination, toute diffusion 
> ou toute publication, totale ou partielle, est interdite, sauf 
> autorisation expresse. L'internet ne permettant pas 
> d'assurer l'integrite de ce message, BNP PARIBAS (et ses
> filiales) decline(nt) toute responsabilite au titre de ce 
> message, dans l'hypothese ou il aurait ete modifie.
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org 
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 



More information about the FreeTDS mailing list