RE: [dbi] Re: Attempt to initiate a new SQL Server operation with results pending.



Daniel,

On 22-Jun-2005 Daniel Kasak wrote:
> Martin J. Evans wrote:
>
>>As far as I am aware this is a limitation of the TDS protocol used and
>>your example code will not work unless you force a server-side cursor (see
>>DBD::ODBC pod and look for odbc_SQL_ROWSET_SIZE but I warn you that you
>>really
>>will need to close everything i.e. force SQLFreeStmt(SQL_CLOSE) or you will
>>get
>>hangs).
>>
>>
> I see. Sounds good.
>
>>BTW, the example in the pod should be $dbh->{odbc_SQL_ROWSET_SIZE} = 2 not
>>$dbh->{SQL_ROWSET_SIZE} = 2.
>>
>>
>>
> Just tried that. Doesn't seem to have any effect on my system. Here's
> the line I added right after create $dbh :
> $dbh->{odbc_SQL_ROWSET_SIZE} = 2;

Didn't you say something about using FreeTDS? If so that hack might not work
for FreeTDS. Against MS SQL Server ODBC driver it works - I tried it with your
example.

>>I would seriously suggest you try and avoid multiple active statements -
>>there
>>is nearly always a SQL or some other way.
>>
>>
> Perhaps. To be honest I'm not that concerned. If it was DBD::mysql I'd
> be mortified, but I don't have too much to do with SQL server, so I'll
> just create lots of $dbh things and ->finish all the statements and hope
> that things hold together while I'm sitting around twiddling my thumbs
> waiting for MySQL-5.0.x to stabalise ( stored procedures & views ).
>
> Thanks for your help.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

.



Relevant Pages

  • Re: DBI DBD-ODBC
    ... Martin J. Evans ... I realised why you were using the like clause but by removing it and seeing the problem go away we now know the problem is with the argument to the where clause. ... When SQLDriverConnect fails DBD::ODBC will have a second attempt with the older ODBC API SQLConnect. ...
    (perl.dbi.users)
  • Re: Bug found when using a stored procedure with DB2 and DBD::ODBC
    ... On 28-Sep-2006 Martin J. Evans wrote: ... I am trying to call a simple stored procedure on an iSeries / AS400: ...
    (perl.dbi.users)
  • Re: prepare_cached - just how much quicker should I expect?
    ... insert into table1 values ... Martin J. Evans ... I cannot see any difference using prepare_cached with a remote mysql or ...
    (perl.dbi.users)
  • ANNOUNCE: DBD::Oracle 1.19
    ... Fixed execute_array to comply with DBI standard from Martin J. Evans, ... Fixed execute_array so it will not throw a Perl warning on undef values in ...
    (perl.dbi.users)
  • Re: DBI DBD-ODBC
    ... Martin J. Evans ... Re: DBI DBD-ODBC ... > Robert V Simmons ...
    (perl.dbi.users)