ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQLRPGLE vs RPGLE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLRPGLE vs RPGLE

    Hi,
    I have a "complex" query to write (many calculated fields and group by options). It's better (talkin' about performance) to include it in a RPGSQLLE (and write pure SQL) or otherwise make an RPG program?

    Thanks

  • #2
    Re: SQLRPGLE vs RPGLE

    If you have good access paths I don't think it will matter. Chaining and reading a file or selecting records from one or more files will be very close. I guess I would go with sql for the readability factor. just my 2 cents.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: SQLRPGLE vs RPGLE

      It depends on whether or not this is an interact or batch application. If batch, it shouldn't matter (refer to DeadMan's post, above). If interactive, there will be a longer "up front" delay with SQL. In other words, if you're writing a report, I'd recommend whichever method you're most comfortable with. If you're loading a page-at-a-time subfile, it'll take longer for and SQLRPGLE program to load the first page, so right off the bat you're users have to sit there and wait. Go with native I/O.
      "Time passes, but sometimes it beats the <crap> out of you as it goes."

      Comment


      • #4
        Re: SQLRPGLE vs RPGLE

        Originally posted by littlepd View Post
        It depends on whether or not this is an interact or batch application. If batch, it shouldn't matter (refer to DeadMan's post, above). If interactive, there will be a longer "up front" delay with SQL. In other words, if you're writing a report, I'd recommend whichever method you're most comfortable with. If you're loading a page-at-a-time subfile, it'll take longer for and SQLRPGLE program to load the first page, so right off the bat you're users have to sit there and wait. Go with native I/O.
        This is an interact application. Query is like this:
        INSERT INTO xxx (SELECT * FROM ...)

        In SELECT query are: 1) inner join; 2) calculated colums; 3) group by columns.
        To do the same thing in RPG I need:
        1- create a logic file ordered by id on the file in FROM clause.
        2- read this file until the end and make a CHAIN to obtain description from another file (like INNER JOIN inside the query)
        3- need many variables to save the values of calculated fields.
        4- every time id (on the logic file) changes I write on the result file (like INSERT INTO clause in SQL) the record with all calculated fields (one row like the same that I obtain with GROUP BY on id field).

        I wrote RPGLE and SQLRPGLE to do the same thing. The result is the same
        but the program that hosts the SQL query is 5 times faster than the other one
        in RPGLE. Is that possible?

        Thanks for your help!

        Comment

        Working...
        X