Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Chapter 3. Connect IBM i5/OS with ODBC > Writing ODBC applications - Pg. 42

Note: OpenOffice requires a primary key on a database file in order to edit the data. If there is no primary key the table is opened as read-only. You can add a primary key with iSeries Navigator or via SQL with the following command: ALTER TABLE tablename ADD PRIMARY KEY (field) 3.4 Writing ODBC applications There are many methods of writing your own Linux applications to access database on IBM i5/OS. This section provides an overview to ODBC programming and demonstrates the usage of unixODBC API with small sample code. The following scenarios are presented in this section: Client Server applications: Using C applications that can fetch an ordinary database file from a back-end i5/OS using the iSeries Access ODBC Driver for Linux. On three tier applications: These are common in Web pages. It uses a PHP module that provides built-in ODBC functions and access to DB2 UDB for iSeries. Using Perl to establish a database connection 3.4.1 Client application written in C The ODBCexample.c is a working example of an application fetching an ordinary database file (QIWS/QCUSTCDT) from a backend IBM i5/OS using the iSeries Access ODBC Driver for Linux. This example assumes that unixODBC and the iSeries Access ODBC Driver for Linux is