RPQSQL / SQLRPG

50 pts.
Tags:
RPG
RPG ILE
RPG IV
RPG/400
RPGLE
RPGSQL
SQLRPGLE
Any body please help Wanted to know the advantage and disadvantage using RPGSQL / SQLRPG I've heard that this is the new one its not only RPG but become one with SQL. Thanks in advance

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

SQLRPG isn’t that new, it’s been around for some time now. It basically allows you to use SQL statements in your RPG program for database operations (embedded SQL). You can embed SQL in ILE RPG or OPM RPG.

The main advantage is that it allows some very complex data selections, which would otherwise involve a lot of RPG coding and database I/O.

The main disadvantage is that it can use a lot of machine resource and adversely affect the performance of your machine. This is very much dependent on how you use it and your database design.

Regards,

Martin Gilbert.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    The main disadvantage is that it can use a lot of machine resource and adversely affect the performance of your machine. That in itself isn't a disadvantage. Writing pure RPG to do the same poorly conceived database operations would result in performing just as badly -- and be much more complex and potentially more difficult to correct. Tom
    125,585 pointsBadges:
    report
  • jstotz
    I've dramatically increased the performance of RPG programs by using logical files instead of embedded SQL. I think you guys like embedded SQL because you either don't know how to use the HLL File operations or you think the SQL experience will help you get a job if your company sunsets you IBM iSeries / AS400.
    10 pointsBadges:
    report
  • Splat
    jstotz, and it could be that some people like to use the best tool available for the particular requirement.
    11,455 pointsBadges:
    report
  • WoodEngineer
    Prior to developing RPG programs with embedded SQL we used IBM's OPNQRYFIL feature which was basically a front-end for SQL.  The advantage at the time was that we did not have the SQL package on our system so this became a substitute.
    Once we learned SQL we were able to dramatically streamline our programs and eliminate OPNQRYFIL.
    The nice thing about writing RPG/SQL programs is that you can start simply and get more complex as your confidence and knowledge allows.
    7,650 pointsBadges:
    report
  • GregManzo
    Each approach has its benefits, embedded SQL can dramatically shorten development times, but if it's something you need to run often keeping a permanent LF around saves a lot on total machine workload.
    1,830 pointsBadges:
    report
  • TheRealRaven
    If replacing embedded SQL with native I/O resulted in "dramatically increased" performance, there are some very likely possibilities. The SQL used was inappropriate for the tasks (it was designed for 'set at a time' operations), the database wasn't well architected, the OS was an older near-obsolete version/release or the programming was simply poor.

    Assuming that "logical files" means using DDS-compiled views rather than DML, it's not an alternative to "embedded SQL". Embedded SQL works whether views are created with DDS or with DML. And SQL views and indexes are already "logical files".

    Once efficient processing is achieved with native I/O, it's most often possible to get even better performance by using appropriate SQL. 
    21,845 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: