How to use ODBC with postgres database on linux

Hello,

I want to use ODBC connection to postgres database  with a cobol SQL program (Visual Cobol + oesql).

I've got this error :

SQL CODE : 000019520-
ORDER : OPEN CURPARMOD
MESSAGE SQL : Connection does not support HOLD cursors

How can i configure my ODBC.ini to work correctly with HOLD cursor

Or is there a postgres ODBC driver on Linux with HOLD cursor capability ?

Thanks for your help.

Laurent.

  • 0  

    Hi Laurent,

    The Visual COBOL documentation for DECLARE CURSOR states the following:

    • If a HOLD cursor is requested and the current connection closes cursors at the end of transactions, the OPEN statement will return an error (SQLCODE = -19520).

    By default, the cursor behavior is set to close cursors after a COMMIT. You can change this behavior by adding the following SQL directive to your program:

    SQL(CLOSE_ON_COMMIT=NO)

    This is documented here.

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • 0 in reply to   

    It's OK.

    Thank you for your help.

    Regards.