i have installed OpenCobolIde with SQL Cobol and i have a problem when i compile a cobol program with exec sql statement. I followed the directives for the configuration and i get this messages :
c:\esqlOC\esqlOC.exe -static -o RUPTURE3.cob RUPTURE3.SQB
c:\esqlOC\esqlOC.exe: ESQL for OpenCobol Version 2 Build Nov 23 2016
... I followed the directives for the configuration ...
Which directives exactly?
What does OCIDE->Preferences->Compiler->Check Compiler says?
I guess it is
cobc (GnuCOBOL) 2.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built Sep 09 2017 18:27:54
Packaged Sep 06 2017 18:48:43 UTC
C version "6.3.0"
Which was shipped with the last release of OCIDE and is a nice GCC based version of GnuCOBOL. OCIDE's documentation says
To work with esqlOC, you need to use GnuCOBOL built with Visual Studio.
but this is wrong (esqlOC works also on GNU/Linux and works on Windows with GCC builds).
The only thing you have to take care is to use a 32/64bit version according to the GnuCOBOL and C compiler you use.
Note: As OCIDE currently adds ".lib" automatically when "compiling" sqb files you need to copy "ocsql.lib" to "ocsql.lib.lib" to get it working.
Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To work with esqlOC, you need to use GnuCOBOL built with Visual Studio. Read Setup a custom compiler on Windows to setup the correct compiler.
1 Setup OpenCobolIDE to work with GnuCOBOL compiled with Visual Studio (make sure you can compile a simple HelloWorld)
2 Download esqlOC and install it somewhere on your drive (prefer a path without spaces such as c:\esqloc).
3 Open the OpenCobolIDE preferences and go to the SQL Cobol tab. There specify the installation directory of esqlOC.
4 Open a .sqb file and compile it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-04-11
Hi simon,
at the end you noted :
Note: As OCIDE currently adds ".lib" automatically when "compiling" sqb files you need to copy "ocsql.lib" to "ocsql.lib.lib" to get it working.
but where should i copy them ?
many thanks for your help,
René
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2018-04-17
Sorry or the delay but i have no PC with windows for the next 2 weeks.
I will come back soon.
Many thanks or your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-03-19
Hi,
Does anyone know why does ESQL for ODBC for GNU COBOL(esqlOC ) print/display a whole lot of information when you run a program, is there a way to turn this off?
13964008 OCSQL: DB connecting using SQLDriverConnect
13964023 OCSQL: DB Connected, Database is 'test'
13964023 OCSQL: EXECUTE IMMEDIATE CREATE TABLE TESTPERSON(ID DECIMAL(12,0), NAME CHAR(50) NOT NULL, PRIMARY KEY (ID))
13935101 OCSQL: SQL code 1050 : 42S01 : [ma-3.1.0][10.1.37-MariaDB]Table 'testperson' already exists
13935101 OCSQL: EXECUTE IMMEDIATE CREATE TABLE TESTGAME(ID DECIMAL(12,0), NAME CHAR(50) NOT NULL, PRIMARY KEY (ID))
13935101 OCSQL: SQL code 1050 : 42S01 : [ma-3.1.0][10.1.37-MariaDB]Table 'testgame' already exists
13935101 OCSQL: EXECUTE IMMEDIATE CREATE TABLE TESTPOINTS(PERSONID DECIMAL(12,0), GAMEID DECIMAL(12,0), POINTS DECIMAL(6,2), CONSTRAINT POINTS_CONSTRAINT1 FOREIGN KEY (PERSONID) REFERENCES TESTPERSON(ID), CONSTRAINT POINTS_CONSTRAINT2 FOREIGN KEY (GAMEID) REFERENCES TESTGAME(ID),PRIMARY KEY (PERSONID, GAMEID))
13935101 OCSQL: SQL code 1050 : 42S01 : [ma-3.1.0][10.1.37-MariaDB]Table 'testpoints' already exists
13935101 OCSQL: PREPARE I/O SELECT SUM(POINTS) FROM TESTPERSON,TESTPOINTS WHERE PERSONID>1 AND PERSONID=ID
13935101 OCSQL: EXECUTE SELECT SUM(POINTS) FROM TESTPERSON,TESTPOINTS WHERE PERSONID>1 AND PERSONID=ID
13935101 OCSQL: PREPARE I/O SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: OPEN CURSOR SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: FETCH SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: FETCH SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: FETCH SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: FETCH SELECT TESTPERSON.NAME,POINTS FROM TESTPERSON,TESTPOINTS WHERE PERSONID=ID
13935101 OCSQL: COMMIT
13935101 OCSQL: DB Closed
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-27
Hi,
I started with OpenCobolIDE with SQL on windows 10
the precompilation works fine, same for the compilation but on the connect
i receive : cannot find entry point 'OCSQL'
if i bypass the connect to go to do a select i receive : cannot find module 'OCSQLPRE'
The Call of my subprograms (in the same library than ocsql.dll) work fine.
One other option (that I'd tend to use for ocsql) would be to add "hard links" to the entry points and library. You may add them with the command line option -locsql -K OCSQL -K OCSQLPRE (the first one can also be specified as ocsql in OCIDE under "libraries").
This way you'll get compile time errors when the library file is not the correct one and your COBOL module will directly call the ocsql functions (without the lookup via libcob). Also the OS will directly complain if ocsql.dll (with the correct matching architecture) cannot be found (the path to the dll must be in PATH in this case [would be LIBRARY_PATH on posix environments]).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-30
Hi Simon,
I added a variable COB_PRE_LOAD with the library of OCSQL.DLL, COB_LIRARY_PATH was already in and i still got :
libcob: PAUTEUR.cob: 134: cannot find entry point 'OCSQL'
I don't understand "You may add them with the command line option -locsql -K OCSQL -K OCSQLPRE" where should i add that ?
Is it possible to you to give me your OCSQL.DLL ?
Many thanks for your help,
René
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-06-30
with pauteur -locsql -K OCSQL
i got the same message :
libcob: PAUTEUR.cob: 134: cannot find entry point 'OCSQL'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2019-07-11
Hi Simon,
I reinstalled all in 32bits and now i have no problem.
Many thanks,
René
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
i have installed OpenCobolIde with SQL Cobol and i have a problem when i compile a cobol program with exec sql statement. I followed the directives for the configuration and i get this messages :
c:\esqlOC\esqlOC.exe -static -o RUPTURE3.cob RUPTURE3.SQB
c:\esqlOC\esqlOC.exe: ESQL for OpenCobol Version 2 Build Nov 23 2016
cobc.exe -x -o bin\RUPTURE3.exe -std=default -Wall -debug -static -Lc:\esqlOC -locsql.lib RUPTURE3.cob
C:\Program Files (x86)\OpenCobolIDE\GnuCOBOL\bin/ld.exe: cannot find -locsql.lib
collect2.exe: error: ld returned 1 exit status
in C:\esqlOC i have ocsql.lib
c:\esqlOC>dir
Le volume dans le lecteur C s’appelle Windows
Le numéro de série du volume est 54D9-745E
Répertoire de c:\esqlOC
10/04/2018 15:23 <DIR> .
10/04/2018 15:23 <DIR> ..
10/04/2018 15:23 120 320 esqlOC.exe
10/04/2018 15:23 396 288 esqlOC.pdb
10/04/2018 15:23 29 184 ocsql.dll
10/04/2018 15:23 1 756 ocsql.exp
10/04/2018 15:23 3 690 ocsql.lib
10/04/2018 15:23 289 792 ocsql.pdb
6 fichier(s) 841 030 octets
If anyone could help me...
Many thanks,
René
Hi René and welcome to GnuCOBOL.
Which directives exactly?
What does OCIDE->Preferences->Compiler->Check Compiler says?
I guess it is
Which was shipped with the last release of OCIDE and is a nice GCC based version of GnuCOBOL. OCIDE's documentation says
but this is wrong (esqlOC works also on GNU/Linux and works on Windows with GCC builds).
The only thing you have to take care is to use a 32/64bit version according to the GnuCOBOL and C compiler you use.
Note: As OCIDE currently adds ".lib" automatically when "compiling" sqb files you need to copy "ocsql.lib" to "ocsql.lib.lib" to get it working.
Simon
i followwed these informations
http://opencobolide.readthedocs.io/en/latest/advanced.html#how-to-setup-dbpre-integration-with-opencobolide
esqlOC (on Windows)
Warning
To work with esqlOC, you need to use GnuCOBOL built with Visual Studio. Read Setup a custom compiler on Windows to setup the correct compiler.
1 Setup OpenCobolIDE to work with GnuCOBOL compiled with Visual Studio (make sure you can compile a simple HelloWorld)
2 Download esqlOC and install it somewhere on your drive (prefer a path without spaces such as c:\esqloc).
3 Open the OpenCobolIDE preferences and go to the SQL Cobol tab. There specify the installation directory of esqlOC.
4 Open a .sqb file and compile it.
Hi simon,
at the end you noted :
Note: As OCIDE currently adds ".lib" automatically when "compiling" sqb files you need to copy "ocsql.lib" to "ocsql.lib.lib" to get it working.
but where should i copy them ?
many thanks for your help,
René
copy c:\esqlOC\ocsql.lib c:\esqlOC\ocsql.lib.lib
Sorry or the delay but i have no PC with windows for the next 2 weeks.
I will come back soon.
Many thanks or your help.
Hi,
Does anyone know why does ESQL for ODBC for GNU COBOL(esqlOC ) print/display a whole lot of information when you run a program, is there a way to turn this off?
Hi,
I started with OpenCobolIDE with SQL on windows 10
the precompilation works fine, same for the compilation but on the connect
i receive : cannot find entry point 'OCSQL'
if i bypass the connect to go to do a select i receive : cannot find module 'OCSQLPRE'
The Call of my subprograms (in the same library than ocsql.dll) work fine.
Is it a wrong version of ocsql i installed ? (from binaries.zip) from http://www.kiska.net/opencobol/
Many thanks fro your help,
René
I assume you've read the OCIDE docs about how to configure the precompiler.
That means that your programs found the dll but cannot load the contained entry points.
You may have mixed 64/32bit?
One possible way to solve it is to preload the (correct matching) ocsql.dll:
COB_PRE_LOAD=ocsql
COB_LIBRARY_PATH=X:\path\containing\dll
One other option (that I'd tend to use for ocsql) would be to add "hard links" to the entry points and library. You may add them with the command line option
-locsql -K OCSQL -K OCSQLPRE
(the first one can also be specified asocsql
in OCIDE under "libraries").This way you'll get compile time errors when the library file is not the correct one and your COBOL module will directly call the ocsql functions (without the lookup via libcob). Also the OS will directly complain if ocsql.dll (with the correct matching architecture) cannot be found (the path to the dll must be in
PATH
in this case [would beLIBRARY_PATH
on posix environments]).Hi Simon,
I added a variable COB_PRE_LOAD with the library of OCSQL.DLL, COB_LIRARY_PATH was already in and i still got :
libcob: PAUTEUR.cob: 134: cannot find entry point 'OCSQL'
I don't understand "You may add them with the command line option -locsql -K OCSQL -K OCSQLPRE" where should i add that ?
Is it possible to you to give me your OCSQL.DLL ?
Many thanks for your help,
René
with pauteur -locsql -K OCSQL
i got the same message :
libcob: PAUTEUR.cob: 134: cannot find entry point 'OCSQL'
Hi Simon,
I reinstalled all in 32bits and now i have no problem.
Many thanks,
René
Thank you for the update.
You can also use 64bit, too - it is just important to have everything in the same architecture :-)