I tried before to install odbc. Gofer new squeaksource: 'ODBC'; package: 'ConfigurationOfODBC'; load. (Smalltalk at: #ConfigurationOfODBC) load. When I execute the code above I got an exception doesNotUnderstand: #selector in RBParser>>externalFunctionDeclaration. Looks like currentScope variable is not defined. Also if I install ODBC from the catalog it also fails. I still don't see how postgres can help but I'll give it another try. On Jan 3, 2018 11:05, "Pierce Ng" <pierce@samadhiweb.com> wrote:
On Wed, Jan 03, 2018 at 10:12:32AM -0500, Andrei Stebakov wrote:
Pierce, I couldn't find any smalltalk framework to work with DB2 at this point. I couldn't also find any Pharo odbc library. That's why at this point I am looking for any ideas how to connect to DB2 from Pharo.
I suppose Instantiations VA Smalltalk will be able to talk to DB2. I'm quite sure Dolphin Smalltalk does ODBC too.
Staying with Pharo, assuming you have known-working DB2 ODBC driver for Windows installed and ODBC to DB2 configured, try this:
http://smalltalkhub.com/#!/~PharoExtras/ODBC/
Most recent commit was in Apr 2015 by Torsten 'switching to newer FFI'. So hopefully this works with Pharo 6.1.
If the above doesn't work, but you know that the Windows DB2 ODBC driver works, then - I'm not being facetious - install PostgreSQL, set up PostgreSQL foreign data wrapper to ODBC, and talk to PostgreSQL using Pharo.
http://www.postgresonline.com/journal/archives/372-ODBC-FDW- now-supports-9.5-and-9.6.html
Or, set up Python's SQL Alchemy for DB2, install PostgreSQL, set up PostgreSQL foreign data wrapper to SQL Alchemy, and talk to PostgreSQL using Pharo.
https://wiki.postgresql.org/wiki/Foreign_data_wrappers https://github.com/Kozea/Multicorn
HTH.