Re: Fujitsu cobol and SQLServer





"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:6ledroFbu0u7U1@xxxxxxxxxxxxxxxxxxxxx


"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."



Pete,

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

Out of interest why are server side cursors not a good idea?

--
Steve

.



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)
  • 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: Using MARS with JDBC Driver
    ... Thank you for the info on query plans and server side cursors I will ... It seemed incredible that a transaction that had just updated ... Since the new connection does not run under the same transaction ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: SQL Server connectivity
    ... I feel like it must be something with the location of the cursors. ... table connection is probably using CLIENT side cursors. ... required by ODBC framework). ... > The problem is that the SQL server was moved to another office and a VPN ...
    (microsoft.public.data.ado)
  • Re: Bidirectional cursor navigation
    ... It has async operations (including async connections), ... has server-side AND client-side cursors, ... >> the wonders of the web implemented connected architectures. ... >> Server can support thousands of users (we ...
    (microsoft.public.dotnet.framework.adonet)