"IODBCChHOWTO" . . . . . "2016-09-14T12:28:34Z" . "2016-09-14T12:28:34Z" . "IODBCChHOWTO" . . . . "2016-09-14T12:28:34.024914"^^ . . "2016-09-14T12:28:34.024914"^^ . . . . "---+ iODBC+Ch HOWTO for Linux/UNIX Systems\n\n\n---++ Disclaimer\n\nThe following is a HOWTO document for installing Ch with iODBC on Linux or\nUnix. Feel free to criticize, suggest modifications, or ask further\nquestions. It is currently maintained by Tim Haynes of Openlink Software\n(iodbc@openlinksw.com)\n\nPrerequisites include basic Unix familiarity, such as creating directories\nand users, using an editor, etc.\n\nThis HOWTO is intended to assist in connecting Ch to back-end databases via\nODBC in a development environment and should not take the place of thorough\ntesting before deployment on a production system.\n\n\n---++ ODBC Overview\n\nODBC (Open Database Connectivity) is an operating system- and database-\nindependent communication API for database connectivity. It enables ODBC\ncompliant client applications to connect transparently to back-end\ndatabases via ODBC function calls which are implemented by ODBC Drivers for\ntarget back-end databases.\n\nODBC provides your applications with database independence;\nconsequentially, you no longer have to incur the development and\nmaintenance cost of inextricably binding your application to backend\ndatabase engines via their proprietary data-access (aka native) APIs.\n\nODBC connections involve an ODBC-compliant Application or Data Access\nLayer, ODBC Driver Manager, ODBC Driver, and back-end Database. The ODBC\nDriver Manager for Microsoft Windows platforms is administered via the ODBC\nAdministrator Control Panel applet at setup and configuration time. The\nDriver Manager registers a set of ODBC driver connection parameters called\na Data Source Name (DSN), and maintains (in persistent form) a relationship\nbetween the DSN and an underlying ODBC Driver that will honor data access\nrequest via that DSN.\n\nAt runtime an application looks to the driver manager for a DSN, and then\npasses the connection parameters specified in the DSN to the appropriate\ndriver, which makes the actual database connection. Under non-Windows\nplatforms you may need to install a Driver Manager if this isn't delivered\nas an integral part of your operating environment. Platform independent\nODBC (aka iODBC) is an Open Source ODBC project (dual license LGPL /\nBSD)for non Windows platforms maintained by OpenLink Software that consists\nof an ODBC SDK (libraries and header files) and ODBC Runtime components\n(Administrator and Driver Manager).\n\n\n---++ HOWTO Preface:\n\nYou will also need an ODBC Driver and Database to complete the\narchitecture.\n\nIf you need ODBC drivers to connect to a third-party database on the same\nor another machine, OpenLink ODBC Drivers are available, and may be\ndownloaded from http://www.openlinksw.com\n\nThe Virtuoso database may also be downloaded from\nhttp://virtuoso.openlinksw.com/\n\nBoth sets of ODBC Drivers are available on a free 30-day evaluation basis.\n\nSupport for setting up the OpenLink Drivers may be obtained at\nhttp://support.openlinksw.com/\n\n\n---++ Installing Ch\n\nIf you already have Ch installed and running, you probably do not need to\nrebuild it. Otherwise, you should install it, thus:\n\nFirst, download the latest distribution appropriate to your OS from\nhttp://www.softintegration.com/ - currently this is version 4.0.\n\nUnpack it with a command like\n\n\ngzip -cd < chstandard-4.0.0.linux2.2.5.intel.tar.gz | tar xvpf -\n\n\nEnter the resultant directory, and run the install script:\n\n\nzsh, purple 1:05PM chstandard-4.0.0.linux2.2.5.intel/ % ls\nREADME ch.bin install.sh* license.txt\nzsh, purple 1:05PM chstandard-4.0.0.linux2.2.5.intel/ % ./install.sh\n\n\nYou will also probably need to set the CHHOME environment variable to the\nbase directory you chose as Ch's installation destination - depending on\nyour current shell, choose one or other of the following:\n\n\n\necho 'setenv CHHOME $HOME/ch4' >> .tcshrc\n\n\nor\n\necho 'export CHHOME=$HOME/ch4' >> .bashrc\n\n\nThese are not necessary if Ch is installed as root into a default\nsystem-wide location.\n\nAfter installation, if you run the command\n\n\nch -d\n\n\nIt will create a ~/.chrc file for you with useful default settings.\n\n\n---+++ Installing Ch on MacOS X\n\nFirst, download the compressed Ch from http://www.softintegration.com/download\n\nYour Mac OS X shuttle will uncompress the file and create a directory such\nas chsandard-4.0.0.macosx in your Desktop. If not, you can decompress and\nuntar the downloaded file with the command:\n\n\n\ngzip -cd chstandard-4.0.0.macosx.tgz |tar xvf -\n\n\nGoto the chstandard-4.0.0.macosx folder on the Mac OS X Desktop,\ndouble-click chstandard-4.0.0.pkg, then follow the instructions to install.\n\n---++ Installing iODBC\n\nIf you do not already have iODBC installed, either install an RPM from\nhttp://www.iodbc.org/, or install from source:\n\n\n---+++ Compiling iODBC from source\n\nRequirements: C-compiler; optionally gtk+-1.2 (required if building from CVS).\n\nAs before, unpack the iODBC sources, enter the build directory, configure, make and make install:\n\n\nzsh, purple 4:13PM C/ % tar xvpfz libiodbc-3.51.1.tar.gz\nlibiodbc-3.51.1/\nlibiodbc-3.51.1/admin/\nlibiodbc-3.51.1/admin/Makefile.am\nlibiodbc-3.51.1/admin/Makefile.in\nlibiodbc-3.51.1/admin/acinclude.m4\n[snip]\nlibiodbc-3.51.1/samples/Makefile.in\nlibiodbc-3.51.1/samples/iodbctest.c\nzsh, purple 4:14PM C/ % cd libiodbc-3.51.1\nzsh, purple 4:14PM libiodbc-3.51.1/ % ./configure --prefix=/usr/local/stow/iodbc-3.51.1\nchecking for a BSD-compatible install... /bin/install -c\nchecking whether build environment is sane... yes\nchecking for gawk... gawk\n[snip]\nconfig.status: executing depfiles commands\nconfig.status: executing default commands\nzsh, purple 4:15PM libiodbc-3.51.1/ % make\nMaking all in admin\nmake[1]: Entering directory `/home/tim/C/libiodbc-3.51.1/admin'\n[snip]\nmake[1]: Leaving directory `/home/tim/C/libiodbc-3.51.1'\nzsh, purple 4:15PM libiodbc-3.51.1/ % su root -c 'make install'\n\n\nIt's advisable to install into /usr/local, or stow your installation into\n/usr/local, as that is searched by most other applications trying to locate\niODBC.\n\n---+++ Testing iODBC\n\nNow is a good time to configure iODBC, by adding a DSN - create a file\n~/.odbc.ini, edit it to look something like this:\n\n\n[ODBC Data Sources]\nPostgreSQL native localhost = PostgreSQL native driver\nLocal Virtuoso Demo = localhost virtuoso (demo instance)\nLocal Virtuoso = localhost virtuoso\n\n[Local Virtuoso Demo]\nDescription = Virtuoso 3.2\nDriver = /home/tim/virtuoso/lib/virtodbc32.so\nAddress = localhost:1112\nUserName = dba\nUser = dba\n\n[Local Virtuoso]\nDescription = Virtuoso 3.2\nDriver = /home/tim/virtuoso/lib/virtodbc32.so\nAddress = localhost:1111\nUserName = dba\nUser = dba\n\n[PostgreSQL native localhost]\nDriver = /usr/lib/postgresql/lib/libodbcpsql.so\nHost = localhost\nServer = localhost\nServerName = localhost\nDatabase = tim\nUserName = tim\nUID = tim\nPort = 5432\n\n\nIt is advisable to export the environment variable ODBCINI to point to this file, too - depending on your shell, either:\n\n\n\necho 'export ODBCINI=$HOME/.odbc.ini' >> .bashrc\n\n\nor\n\n\necho 'setenv ODBCINI $HOME/.odbc.ini' >> .tcshrc\n\n\nas appropriate.\n\nYou can now make a test connection with the _iodbctest_ utility, thus:\n\n\n\nzsh, purple 4:54PM libiodbc-3.51.1/ % which iodbctest\n/usr/local/bin//iodbctest\nzsh, purple 4:54PM libiodbc-3.51.1/ % iodbctest \niODBC Demonstration program\nThis program shows an interactive SQL processor\nDriver Manager: 03.51.0001.0908\n\nEnter ODBC connect string (? shows list): ?\n\nDSN | Description \n---------------------------------------------------------------\nLocal Virtuoso | localhost virtuoso \nLocal Virtuoso Demo | localhost virtuoso (demo instance)\nMySQL | MySQL native driver \nPostgreSQL native localhost | PostgreSQL native driver \nPostgreSQL OpenLink localhost | PostgreSQL over OpenLink multi-tier\nVirtuoso30 | OpenLink Virtuoso 3.0 \n\nEnter ODBC connect string (? shows list): DSN=Local Virtuoso Demo;UID=dba;PWD=cens0red\nDriver: 03.50.2505 OpenLink Virtuoso ODBC Driver\n\nSQL>\n\n\nIf you see the SQL> prompt there, then all has gone well.\n\n\n\n\n---++ Interfacing with Ch\n\nSoftIntegration.com provide a module for Ch to interface with iODBC - you\nshould download the chiodbc module from http://www.softintegration.com/.\n\nInstalling this is simple; unpack the tarball into $CHHOME/package/ directory, thus:\n\n\n\nzsh, purple 1:49PM chstandard-4.0.0.linux2.2.5.intel/ % cd ~/ch4/package \nzsh, purple 1:49PM package/ % gzip -cd < ~/Downloads/chiodbc-3.5.0.linux2.2.5.intel.tar.gz| tar xvpf -\n\n\nNow you need to set two variables in Ch's startup script to tell it where\nto find the system-wide installation of iODBC - edit $CHHOME/config/chrc or\n~/.chrc and insert the following two lines:\n\n\n_ppath = stradd(_ppath, \"/home/tim/ch4/package/iodbc;\");\n_ipath = stradd(_ipath, \"/home/tim/ch4/package/iodbc/include;\");\n\n\nYou can also export the ODBCINI environment variable from within Ch, thus:\n\n\necho 'putenv(\"ODBCINI=$HOME/.odbc.ini\");' >> .chrc\n\n\n\n---++ Sample script combining Ch and iODBC\n\nHaving configured a DSN above, you should be able to use both the simple.c and odbctest.c scripts, thus:\n\n\n\nzsh, purple 2:05PM demos/ % ch\nCh \nStandard edition, version 4.0.0.11291 \n(C) Copyright 2001-2003 SoftIntegration, Inc.\nhttp://www.softintegration.com\n/home/tim/ch4/package/iodbc/demos> cd $CHHOME/package/iodbc/demos\n/home/tim/ch4/package/iodbc/demos> ls\nodbctest.c simple.c\n/home/tim/ch4/package/iodbc/demos> ./simple.c\nSQLAllocHandle() OK\nSQLSetEnvAttr() ok\nSQLAllocHandle() ok\nSQLSetConnectAttr() ok\n\n/home/tim/ch4/package/iodbc/demos> ./odbctest.c\nOpenLink ODBC Demonstration program\nThis program shows an interactive SQL processor\n\nEnter ODBC connect string (? shows list): DSN=Local Virtuoso Demo;UID=dba;PWD=cens0red\nDriver: 03.50.2604 OpenLink Virtuoso ODBC Driver (virtodbc.so)\n\nSQL>select * from Demo.demo.Shippers\n\nShipperID |CompanyName |Phone \n-----------+----------------------------------------+------------------------\n1 |Speedy Express |(503) 555-9831 \n2 |United Package |(503) 555-3199 \n3 |Federal Shipping |(503) 555-9931 \n\nresult set 1 returned 3 rows.\n\n\n\n\n---++ Additional Resources\n \n * [[http://www.iodbc.org][iodbc.org]] , the home of iODBC\n * [[http://www.softintegration.com/][SoftIntegration.com]] , authors of Ch\n * [[http://www.softintegration.com/products/toolkit/odbc/][Ch iODBC home]] \n * History of [[index.php?page=docs/odbcstory][ODBC on Unix]] \n * [[http://www.openlinksw.com/][OpenLink Software]] - [[http://www.openlinksw.com/support/suppindx.htm][Support]] , [[http://www.openlinksw.com/support/teclinks.htm][links]] and [[http://www.openlinksw.com/info/docs/odbcwhp/tableof.htm][white-papers]] \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" . . . . . "IODBCChHOWTO" . . . . . . . . . . . "e127eb2bd0df7e8bf047c2a62970c05c" . .