I am new to DB2. I am writing a called program that will receive a field from another program and look it up in a DB2 table and send back a return code along with data in Linkage Storage. The calling program can call my program one time or 3 million times in a row. I will open the DB2 table only once on the 1st call.
On the subsequent calls I will do a Declare Cursor, Open Cursor and a Fetch Cursor. Will this take care of reading randomly? Do I still need to do a read also or does the Fetch Cursor get my next record? Do I need to close the Cursor after each call to re-position the cursor before the next call to my program?
Thanks in advance for any help.