Skip to main content

Hi

I'm running into an error when using a cursor that fetches 0 results which results in an error and reports 'SQL error -9514 Invalid Cursor State)'.  We are using the current SQL directives:

SQL(DBMAN=ADO) SQL(BEHAVIOR=ANSI) SQL(CHECK) SQL(DB=CSISD) SQL(TARGETDB=MSSQLSERVER) SQL(DEF_CURSOR=RO) SQL(ALLOWNULLCHAR)

Running from a Windows 10 VM to SQL Server 2016 on a Windows Server 2012 rd (soon to be Windows Server 2022).

I've found that DEF_CURSOR is still valid as per the Micro Focus documentation however according to VS 2019 'Invalid directive. The selected directive is not valid for this version of the product'.

Any ideas?

James

Hi

I'm running into an error when using a cursor that fetches 0 results which results in an error and reports 'SQL error -9514 Invalid Cursor State)'.  We are using the current SQL directives:

SQL(DBMAN=ADO) SQL(BEHAVIOR=ANSI) SQL(CHECK) SQL(DB=CSISD) SQL(TARGETDB=MSSQLSERVER) SQL(DEF_CURSOR=RO) SQL(ALLOWNULLCHAR)

Running from a Windows 10 VM to SQL Server 2016 on a Windows Server 2012 rd (soon to be Windows Server 2022).

I've found that DEF_CURSOR is still valid as per the Micro Focus documentation however according to VS 2019 'Invalid directive. The selected directive is not valid for this version of the product'.

Any ideas?

James

Hi James,

What Visual COBOL 8.0 Patch Update level do you have installed?

I tested this with 8.0 PU6 and I am not experiencing your reported behavior. I do not get a compile error on the directive and when the fetch is done it returns -100 as it should. 

I did my test with SQL Server 2017.


Hi James,

What Visual COBOL 8.0 Patch Update level do you have installed?

I tested this with 8.0 PU6 and I am not experiencing your reported behavior. I do not get a compile error on the directive and when the fetch is done it returns -100 as it should. 

I did my test with SQL Server 2017.

Hi Chris

A decision was made by the team to run v8 with no patch updates however I had suggested we do so.  I've spoken with the team now and I will proceed to update to PU6 and will let you know if this resolves the issue.


Hi Chris

A decision was made by the team to run v8 with no patch updates however I had suggested we do so.  I've spoken with the team now and I will proceed to update to PU6 and will let you know if this resolves the issue.

I also tested this here without any patch updates and I still did not experience the problem, but I am using a very simply program. It will be interesting to see if updating does indeed fix the problem on your end.

Does this happen on any program that has SQL in it or is it isolated to specifc programs?


I also tested this here without any patch updates and I still did not experience the problem, but I am using a very simply program. It will be interesting to see if updating does indeed fix the problem on your end.

Does this happen on any program that has SQL in it or is it isolated to specifc programs?

Thanks Chris

On a further debug session I've noted that when a record is fetched successfully then the subsequent fetch nets a null result we receive -9514 which from what I can see indicates the cursor is still open. I've been able to implement a change to one of our SQL copybooks to counteract this.