|Subject:||Re: [GnuCOBOL-users] How should I preprocess my source file on GNU/Linux with GNUCobol for SQL Server?|
|Date:||Mon, 8 Oct 2018 10:19:12 +0200|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0|
I really appreciate having a response, thank you for the welcome ;)
I follow your instructions and reinstall ESQL as follow:
svn checkout https://svn.code.sf.net/p/open-cobol/contrib/ open-cobol-contrib
sh configure --with-mssql
We should have something like:
Use Microsoft SQL Server YES
sudo make install
In that way, I probably avec MS SQL Server support.
I try the ODBC connection:
isql SQLServer sa myPassword -v
+---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL>
Then I continue the tutorial to just have a connection and perform a status-check.
The pre-process gives me:
esqlOC: ESQL for GnuCOBOL/OpenCobol Version 2 (2018.10.03) Build Oct 8 2018 esqlOC: ERROR compiling program 'sql_odbc.cbl': line 35 of sql_odbc.cbl: variable not found: BUFFER
I also have this problem on my own code (and some other error, but I need first to be connected ^_^).
Have you any idea about the way to declare and use a variable for the connection to an ODBC database?
Thanks you in advance and have a nice week ;)
Le 07/10/2018 à 21:45, Simon Sobisch a écrit :
Am 06.10.2018 um 21:01 schrieb address@hidden:Hi all, I'm Oliver. I come from Strasbourg (France) and I recently study Cobol @school.Hi Oliver and welcome to GnuCOBOL.As I have no budget for Windows, I start using Cobol on GNU/Linux.It is reasonable to not use Windows for many reasons (even if you'd get it in exchange of "only" your privacy and security)First it was awesome! I create PIC, SCREEN section, and make few things.Good to hear.But now we start connecting to a MS SQL Server. If I can start SQL Server and do ODBC connection on it with iSQL, it's another difficulty to make my code working with EXEC SQL command. So my question is: what should I use to preprocess .cbl files with SQL commands to connect to a SQL Server?Depends on what your study uses. For COBOL you'd use in most cases EXEC SQL (which does some setup and internal CALLs inserted by preprocessing) some may prefer direct CALL to SQL libraries.I found this http://www.kiska.net/opencobol/esql/index.htmlReasonable. I'm not 100% sure if this is up-to-date and would always go to its home in the GnuCOBOL contributions: https://sourceforge.net/p/open-cobol/contrib/HEAD/tree/trunk/esql/and installed esqlOC successfully. But some errors remains here: https://github.com/blankoworld/cobol_menu/blob/master/Menu/Main.cblAs you don't posted any actual error it is not that likely that others can point you to a solution. I suggest to ensure you use the most current ESQL version and if errors remain then post the actual errors.Does anyone can do something with that or explain me how to use OpenESQL?Obivously (or not?) you'd have to setup ODBC on your GNU/Linux environment and get a working connection to a working SQL Server (not 100% sure about its current status on Linux OS, but if I remember correctly this should be working at least for testing environments). The link above includes a README, does this help already?Thank you in advance!Welcome again, Simon
-- Olivier Dᴏꜱꜱᴍᴀɴɴ
|[Prev in Thread]||Current Thread||[Next in Thread]|