I'm about to create a support case regarding this. Before I do I'm just curious if anybody has gotten this to work?
On a clean Win10 install
- visual studio 2022, version 17.6.2
- visual cobol 8 with PU07
- oracle instant client 32 and 64-bit, versions 19 and 21
What I'm trying to do is this:
- Simple program using cobol and procob with oracle instant client
- Program reads db name, user name, and password from environment variables
- Connects to database
- Reads System Context
- Updates client info
No other dependencies, only copy used is sqlca
Before starting Visual Studio two directories are added to the front of PATH
- instantclient_xx_xx\\sdk - location of procob.exe, installed as c:\\oracle32\\instantclient_19_18\\sdk or c:\\oracle64
- instantclient_xx_xx - location of oracle dll:s
The solution is int/gnt, debug as console application
Compiling isn't a problem. Procob is found, source code is OK.
Setting up a 32-bit project and a 64-bits project.
Testing four different instant clients two 32-bit and two 64-bit (19 and 21) since there has been some changes in version 21.
No combination of clients with different config runs the program to completion.
With 32-bit projects and clients the common error is RTS173 at connect to database.
Quick aside, the normal way we have this configured in the current setup of VS 2019, VC 7, instant client 19 32-bit is to make a copy of the file orasql19.dll as orasql8.dll this enabled things to work without the need of any extra configuration. Even though the normal recommendation is using a procedure pointer or the initcall directive.
Some results, client 19.18 32-bit
- no extra config, RTS173 program ORASQL8 at connect
- with a copied orasql8.dll in the instantclient dir, RTS173 program ORASQL8 at connect
- procedure pointer ORASQL19, RTS173 program ORASQL8 at connect
- procedure pointer ORASQL8, RTS173 program ORASQL8 at connect
- initcall"ORASQL19", RTS173 program ORASQL19 at debug start
- initcall"ORASQL8", RTS173 program ORASQL8 at debug start
With client 21.07 basically the same results, we use entry point ORASQL instead of ORASQL19, but RTS173 is the error
Moving to client 19.18 but 64-bit the results are a bit different. At connect we get SQLCODE -1 which should be unique constraint violated, but when running the tests with connection trace activated we can see that no attempt to connect to the remote server is made. The error is internal to the client. A clue is in the error message which is "ORA-00001: unique constraint (%s.%s) violated" i.e an incomplete error message
Results with client 19.18 64-bit
- no extra config, RTS173 program ORASQL8 at connect
- with a copied orasql8.dll, SQLCODE -1 at connect
- procedure pointer ORASQL19, SQLCODE -1 at connect
- procedure pointer ORASQL8, RTS173 program ORASQL8 at connect
- procedure pointer ORASQL8 with copied orasql8.dll, SQLCODE -1 at connect
- initcall"ORASQL19", at debug start RTS114 Attempt to access item beyond bounds of memory
- initcall"ORASQL8", at debug start RTS173 program ORASQL8
- initcall"ORASQL8" with copied orasql8.dll, SQLCODE -1 at connect
With client 21.09 basically the same results.
A fairly large number of tests with 32 and 64-bit clients, and different suggested methods to connect to oracle. None works. A mix of RTS173, RTS114, and SQLCODE -1
I'm unable to come up with any additional test and will submit at much wordier entry as a support case. But I cannot help to be curious about if anyone else has tried this and found a workable solution.
Someone at MF really should write a white paper about how to configure visual cobol and pro*cobol/instant client ON WINDOWS since today the information is spread out in different forum posts and knowledge base articles. With a lot of it being quite old or for unix/linux. Not the most fun of subjects but one that needs some love and a document that is current.
TL;DR If you're using VS 2022 and VC 8 with Oracle Instant Client 32 or 64-bit and it's working flawlessy compiling and debugging. How on earth did you do it?
In confusion,
Robert


