RE: :ODBC to SQL Server - can 2 queries be open at same time on 1 connection

From: Jeff Urlwin (jurlwin_at_esoftmatic.com)
Date: 04/07/04


To: "'Graham Davison'" <graham@metrex.net>, <dbi-users@perl.org>
Date: Wed, 7 Apr 2004 13:55:29 -0400


>
>
> Hi.
>
> Is it possible to have two queries open at the same time on one
> connection to a DB? I'm using DBD::ODBC to access an SQL
> Server DB, if
> that makes any difference.
>
> I'm trying to access some info from one set, then, based on the the
> info from each result to that query, I need to get some info from
> another query. This works for about 63 queries, then I get an error
> message that says: "DBD::ODBC::st fetchrow_hashref failed:
> [OpenLink][ODBC][Driver]Function sequence error (SQL-HY010)(DBD:
> st_fetch/SQLFetch err=-1)"
>
> If I remove the accesses to the data from the second query, I
> get this
> error message: "DBD::ODBC::st fetchrow_hashref failed:
> [OpenLink][ODBC][Driver]Connection is busy with results for another
> hstmt. (SQL-IM921)(DBD: st_fetch/SQLFetch err=-1)"

First, I encourage you to examine the DBD::ODBC POD documentation, and
DBD::ODBC::Changes POD docs to notice that DBD::ODBC 1.08 and above allow
setting of odbc_cursortype. t/20SqlServer.t has a test which shows how you
can use this odbc_cursortype.

If that doesn't work for you, then I would google through this group and a
few (maybe more) months ago there was a LONG thread about it with options on
how to handle this (including some safe and not so safe options)

Regards,

Jeff



Relevant Pages

  • Re: Giving an application a window icon in a sensible way
    ... it should be fairly obvious that a google search with the query "ant" ... A three letter query with a different, ... server etc ... In fact, the choice is to argue here, or to use ...
    (comp.lang.java.programmer)
  • Re: xterm - how to disable eight-bit rewriting
    ... Google is unable to return results more recent than 6 months (or even ... But the outages sound more like they've lost some context from the ... server that tends to handle my queries (noting that the same query from ...
    (comp.windows.x)
  • Re: :ODBC to SQL Server - can 2 queries be open at same time on 1 connection
    ... On 7 Apr 2004, at 12:55, Jeff Urlwin wrote: ... >> another query. ... > If that doesn't work for you, then I would google through this group ... > how to handle this (including some safe and not so safe options) ...
    (perl.dbi.users)
  • Re: MailMerge hangs and crashes with Access on Server
    ... Since I am fairly new to working in this environment, I am not sure what you mean by an "Access group" with help to restructuring the query? ... "Peter Jamieson" wrote: ... All I know is that the performance of queries depends to a large extent on whether, for example, a join is performed on the client side, or on the server side, incurring no network traffic and potentially benefitting from caching on the server. ... There are no dialog boxes, and actually, I have now split the database, and have kept the Word templates and the Access frontend locally on my machine, and moved the backend to the server. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Performance Benchmarks?
    ... Are attribute relationships defined properly on the dimensions? ... If you run Profiler against the server, how long is spent in "Query ... I have created aggregations (Partitions tab in cube design). ...
    (microsoft.public.sqlserver.olap)