× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



By default, in the RPG code itself. If it gets really crazy, or it needs
to be shared among different modules, move it to a function or stored proc
at that time.

Inline SQL is my go-to.



On Sat, Mar 21, 2026 at 9:47 AM Richard Schoen <richard@xxxxxxxxxxxxxxxxx>
wrote:

Another interesting philosophy question.

When embedding SQL calls in RPG I have seen two schools of thought.

-Embed your SQL processing into your RPG code.

-Embed you SQL processing into the DB itself: Stored Process/SQL
Functions, etc…. and call those from RPG.

Personally I like putting my SQL logic into my RPG code as it’s much more
debuggable whereas I don’t think it’s simple to debug SQL stored procedures
and functions.

In other words I try to keep the actual access logic as simple as possible
and put business logic in re-usable code. I generally call the the business
layer.

I do this similarly in other languages. And generally I haven’t replied a
lot on stored procedures in any language or database. I put all my DB and
business logic in separate modules.

I’m just curious what other here favor when writing their RPG logic.
Embedded SQL in RPG or using Sprocs/Functions and keep your RPG dumb as a
stump/simplified :-)

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.