Some of the information here may be outdated, please check the book instead


  • web2py 1.58 or newer with pyodbc,
  • iSeries (Client) Access ODBC driver,
  • an iSeries (AS/400, i5) with OS V5R3 (or newer, but it might work on V5R2 too).

Define a System DSN to your iSeries:

in the General tab enter a name for it under "Data source name" and under "System" enter the server's IP address, in the Servers tab set the "SQL default library" to "web2py" and under the Packages tab set "Package library" also to "web2py", use the defaults for everything else.

On the iSeries run the following commands to create the WEB2PY library where your tables will be stored and to enable automatic journaling on them (Note: the values in the CRTDTAARA command are exactly 10 chars each):

   VALUE('WEB2PY    QDFTJRN   *FILE     ')

Now authorize your ODBC user (in this case TEST) to the journal:


In your model use:


Please read the following extract from a paper written by Ken Milligan and available from:


Distinguishing the three DB2 family members

With the addition of DB2 for i5/OS to the DB2 UDB family, there are now three members in the DB2 product line, as follows:

  • For many years, DB2 was exclusively available on the mainframe. That product is now known as DB2 for z/OS.
  • DB2 for i5/OS was the last database product to join the DB2 brand, but as mentioned above the core of its relational database engine was developed back in the 1980’s.
  • The youngest database member is DB2 9.5 for distributed platforms – it’s is the single product that is available across all Linux™, UNIX®, and Microsoft® Windows® platforms. This product is also known as DB2 for Linux, UNIX, and Windows). This product was actually the founding member of the DB2 Universal Database brand, but that branding was dropped in 2006.

The most common misconception about DB2 branding is this: It infers that IBM has implemented a single, common code base on all of the supported platforms and operating systems. On the contrary, each DB2 brand member's code version is unique and developed by different IBM laboratories, but a tremendous amount of technology sharing takes place at various levels across IBM and the DB2 brand. The different code bases allow IBM to exploit the hardware, microcode, and operating system of each of the respective platforms. Thus, at the lowest level, each DB2 offering is tightly integrated into, and exploitive of, its operating environment. This is good news, as you can imagine, and as you will come to understand more clearly as you continue reading.

Another misconception is that the DB2 9.5 product is the master version of DB2 – meaning that the SQL functionality it contains is a superset of all the functionality in the DB2 product family. Much of that confusion is caused by the fact that the version numbers used by DB2 for i5/OS version numbers are completely independent from the version numbers used by the other two DB2 products. The DB2 for i5/OS version number matches the version of the i5/OS operating system with which it ships. The reality is that each DB2 product has SQL functionality that it delivered first to the market and that is unique to that product. For example, DB2 for i5/OS was the first DB2 product to support SQL stored procedure and is the only product that supports encoded vector indexes.



© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.