110 pts.
 How to use API to access DB2 file on iSeries
Gredon would like to access (search, read, insert, update and delete) a DB2 file on the iSeries with an API. He said he's searched the IBM manual, but he couldn't find the APIs that he can use. Can you help him? -- Michelle Davidson, editor, Search400.com

Software/Hardware used:
ASKED: October 11, 2005  10:23 AM
UPDATED: November 15, 2009  3:42 AM

Answer Wiki:
The key to understanding how to do this is that DB2 tables are AS/400 files. (Actually, they're members of AS/400 files, but generally there is only one member in the file.) So, to access these tables, you open the file, define records as you usually define records in RPG or structures in C/C++, use record read/write/seek/delete calls (all starting with _R, such as _Rreadk, et cetera), and close the file at the end. Note that there will be a separate vector of null flags if the file allows, and that VARCHAR fields are stored as a 16-bit integer, followed by a fixed-length number of characters. /s/Sheldon Linker Linker Systems, Inc. 800-315-1174 Outside of North America use +1-949-552-1904 http://linkersystems.com mailto:sol@linker.com ====================================================== The APIs would likely be the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/database2.htm">Call Level Interface (CLI) APIs</a>. In other environments, these would probably be called "ODBC". Tom
Last Wiki Answer Submitted:  November 15, 2009  3:42 am  by  SheldonLinker   15 pts.
All Answer Wiki Contributors:  SheldonLinker   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _