On Tue, July 12, 2011 05:20, Martin J. Evans wrote: > On 12/07/11 13:04, ZhangJun wrote: >> mostly I use mysql, DBD::mysql, >> also mssql, ODBC and sybase driver. > > I cannot comment on DBD::mysql (as it has been years since I last used it) > but both MS SQL Server and Sybase (I believe) don't support multiple > active statements on the same connection unless you enable something like > the new MARS support in MS SQL Server (but it has other disadvantages). I > wrote a small document for DBD::ODBC at > http://www.easysoft.com/developer/languages/perl/multiple-active-statements.html > which describes the issues and workarounds. > > Multiple Active Statements (MAS) are more than one statement in the same > connection that have active work (or result-sets, Multiple Active Result > Sets (MARS)). > > If you are writing code which may connect to multiple DBDs then I'd avoid > multiple active statements. Often they can be avoided by a simple > reorganisation of your SQL. If you absolutely have to have them then you > can use multiple connections but this also has other disadvantages. > > Personally, I try to avoid them as much as possible and usually find the > code using multiple active statements can be rewritten to use one. > > But basically, I'm just repeating what is in the document referenced > above. > > Martin > -- > Martin J. Evans > Easysoft Limited > http://www.easysoft.com DBD::mysql supports multiple open statements with a single connection.� Used to think this was the standard mSQL even did so I thought it was the standard <sigh />
One of the great frustrations I had going between MySQL and MS SQL was I had to open a separate connection ($dbh) for each statement.� We gave up when we couldn't get any clients to sign releases which were the MS license translated to English.�� That and I got tired of coming in at 2 am to reset the windows server because of Code Red Worm attacks, which MS had known about for two years.� ------ William R. Mussatto Systems Engineer http://www.csz.com 909-920-9154