+ Reply to Thread
Results 1 to 3 of 3

Thread: Stored procedure Or RPG or...

  1. #1

    Default Stored procedure Or RPG or...

    > File A has millions of records and File B (dependent on A) has many more related records. Based on cut-off date, I need to extract data from A and related data from B and write to a workfile.
    > Can someone suggest me what is the best way to achieve the same
    I would suggest that you recommend to your boss that this project be outsourced. Personally, I'd have a CL doing a OPNQRYF on FILE A to select on the date range, and call an RPG with a input primary on FILE A with a SETLL/DOW/READ loop on FILEB. But that's just me. Depends on the details of the situation. Plus old habits die hard. Good Luck.

  2. #2

    Default Stored procedure Or RPG or...

    Hi All, I nee a help in following situation: File A has millions of records and File B (dependent on A) has many more related records. Based on cut-off date, I need to extract data from A and related data from B and write to a workfile. Can someone suggest me what is the best way to achieve the same— 1. Create join logical on A and B and process in RPG, Or 2. Use stored proc (which one SQL or RPG) Or 3. Use SQLRPGLE Or 4. Use OPNQRYF Or 5. …… Thanks, Asheesh

  3. #3

    Default Stored procedure Or RPG or...

    Your choices are not "or"s. A stored procedure is not another method, but a way you could implement one of the other methods. It depends on several factors. Will this be run often? Do the selection criteria change each time? Is it run often? An OPNQRYF is just another way to run an SQL, so below, when I say SQL, that could mean SQL, SQLRPG, OPNQRYF, etc. The SQL solution will cause an index to be built every time. If it is run once a month, this may not be a problem. This can be tuned and sped up dramatically by building the right permanent indexes. The LF solution will make it run faster, but will use disk space and impact performance on the rest of your system (not much with only 5 million records, but how many in the detail file?) It's really a complex question. Many a series of articles have been written on just this subject. Actually, many classes and articles have been written just on the subject of how to create indexes to speed up SQL. I've been addressing this type of situation for years now, and still have to evaluate each one carefully when it starts involving millions of records. Sometimes I run benchmarks to make sure my theorizing gets the results I think it should. You can keep giving us more information in here and we'll try to help, but your best bet is someone on-site with the years experience needed to know what to look for and what to try. Other than that, just experiment. BTW, my pet solution is usually dynamic SQLRPG or SQL with combinations of LFs and EVIs for performance. I like keeping the SQL with the program rather than separate in an OPNQRYF.

+ Reply to Thread

Similar Threads

  1. Testing Stored Procedure
    By Guest.Visitor in forum Dev Tools
    Replies: 3
    Last Post: 11-30-2006, 07:06 AM
  2. Call Service Program Procedure as an SQL Stored Procedure
    By buck.calabro@commsoft.net in forum RPG
    Replies: 2
    Last Post: 01-24-2005, 11:53 AM
  3. VB.Net stored procedure example
    By prospec@iol.ie in forum Visual Basic
    Replies: 4
    Last Post: 07-11-2003, 06:58 AM
  4. SQL Stored Procedure Error
    By Guest.Visitor in forum Programming
    Replies: 2
    Last Post: 11-06-2001, 09:31 AM
  5. Ms access and Stored procedure
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts