Re: Fujitsu cobol and SQLServer





"Steve Rainbird" <steve.nospam.rainbird@xxxxxxxxxxxxxxxxx> wrote in message
news:6le8dmFbtr82U1@xxxxxxxxxxxxxxxxxxxxx
I have a Fujitsu Cobol program connected to an sql server database via
odbc.

I have one cursor already open, when I try and open another cursor I get
the
following error.

[Microsoft][SQL Native Client]Connection is busy with results for another
command

I think from googling that I need to tell the odbc driver to use server
side cursors but have
no idea about how to do this.

Any help gratefully received

Regards
--
Steve
Server side cursors with SQL Server are not a good idea and are best
avoided. As far as I know, there is no way in COBOL you can specify them
anyway.

Set up two connections to the database and switch between them. (See also:
"The solution" under "RDB limitation" thread in this newsgroup.)

EXEC SQL
CONNECT 'DBServer' AS 'conn1' *> assumed userid and password are in
your ODBC.inf file
END-EXEC
EXEC SQL
CONNECT 'DBServer' AS 'conn2' *> assumed userid and password are in
your ODBC.inf file
END-EXEC

Fujitsu assumes last connection until/unless you use SET CONNECTION.

Declare and open each of your 2 cursors under a separate connection.

You cannot set more than one connection to DEFAULT.

Pete.
--
"I used to write COBOL...now I can do anything."


.



Relevant Pages

  • Re: Fujitsu cobol and SQLServer
    ... "Steve Rainbird" wrote in ... Server side cursors with SQL Server are not a good idea and are best avoided. ... Fujitsu assumes last connection until/unless you use SET CONNECTION. ... With microfocus cobol I never had this problem (true it is 4 or 5 yesrs since I used Mf and SQL server I tend to use Oracle). ...
    (comp.lang.cobol)
  • pg/python release
    ... Detect errno.ECONNRESET and properly mark the connection as 'LOST' ... The programmer's client providing both DB-API 2.0 and GreenTrunk ... Protocol level cursors (You can even open cursors created on the ...
    (comp.lang.python.announce)
  • Re: ADO - Bad when it is time to Optimize
    ... Infact we have a single Data Access Entry point from .NET and ATL. ... And inside the data access component, the recordset created has the ... connection creeping due to "Forward Only" cursors. ...
    (microsoft.public.data.ado)
  • Re: Fujitsu cobol and SQLServer
    ... I think from googling that I need to tell the odbc driver to use server ... Server side cursors with SQL Server are not a good idea and are best ... Fujitsu assumes last connection until/unless you use SET CONNECTION. ...
    (comp.lang.cobol)
  • Re: performace issue with a stored procedure
    ... the connection. ... Look for the high CPU command in the ... >>big difference between ODBC versus OLEDB connections ... >(ODBC tends to use cursors when it isn't ...
    (microsoft.public.sqlserver.programming)