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

From: Graham Davison (graham_at_metrex.net)
Date: 04/08/04


Date: Thu, 8 Apr 2004 14:59:47 -0500
To: "Jeff Urlwin" <jurlwin@esoftmatic.com>

On 7 Apr 2004, at 12:55, Jeff Urlwin wrote:

>>
>>
>> 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)

I tried the odbc_cursortype solution in the POD docs, and it
unfortunately didn't help. I looked a bit for the thread that you
mentioned, but not too hard. I managed to get it working by opening two
connections to the DB; not aesthetically pleasing, but it works.

Thanks,
Graham



Relevant Pages

  • RE: :ODBC to SQL Server - can 2 queries be open at same time on 1 connection
    ... > another query. ... If that doesn't work for you, then I would google through this group and a ... how to handle this (including some safe and not so safe options) ...
    (perl.dbi.users)
  • Re: How would the God of Standard Sql - Celko do server side paging?
    ... I think that first my query is checked against other previously ... A lot of people Google "<movie star ... Then using the same model as a report server, ... If I ask a truly original query of Google, ...
    (microsoft.public.sqlserver.programming)
  • Re: command-line search engine query
    ... But I'll assume Jens is right and you meant to query for, let's say, ... "saturn," and see where NASA came up in the results. ... luckily we /know/ what platform you use: Linux. ... This fetches the Google results page for a query on "saturn". ...
    (comp.programming)
  • Re: Google Architecture
    ... I'm always amazed when Google ... reformulate the query. ... Contrast this model to a traditional business enterprise I once worked at. ... If a report listed erroneous matches, ...
    (bit.listserv.ibm-main)
  • Re: That first goal
    ... Not really our fault that nobody discusses Everton but Everton fans on the internet. ... I guess someone needs to explain how Google works for you, then you might understand what I was saying. ... terms in that exact order. ... You were using a 3rd party system to query Google. ...
    (uk.sport.football.clubs.liverpool)