Home > Ask the AS/400 Experts > Questions & Answers > Processing database records
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Processing database records

Jim Mason EXPERT RESPONSE FROM: Jim Mason

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site
>
QUESTION POSED ON: 14 August 2003
If I have a database, how can I select the records I want to process based on the value in a given field in the table? I have an RPG program that processes all records in the table correctly, but I want to limit the records processed by the company field.

>

You have several options.

1. Use OPNQRYF. You can replace the primary data file you process for input with an OPNQRYF select in a CL program that calls your RPG program. OPNQRYF can use a dynamic select statement to select just the records you want. Using an OVRDBF with a shared access path on the primary input file, your existing RPG program will pick up only the selected records.. very nice.. least amount of change.

2. Use embedded SQL in RPG. Works, but requires changing the RPG program to embedded SQL statements. OK, but embedded SQL in RPG is a lot more work than Java and JDBC.

3. Use Java and JDBC stored procedure. Building on option 1, you can define the CL program with the OPNQRYF as a Stored procedure and access it as a component using JDBC driver from the Java toolkit (5722-JC1 and jt400.jar file). Then you can web-enable this as a service anyway you want: Web browser, Web service, XML etc.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

Check out these Best Web Links on Web development.

Ask the Experts yourself: Our Web development gurus are waiting to answer your questions.

Ask your Web development & WebSphere questions -- or help out your peers by answering them--in our WebSphere & Web Development Forum.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts