× 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.


  • Subject: Re: SQL processing in RPG programs
  • From: "R. Bruce Hoffman, Jr." <rbruceh@xxxxxxxxxxxxx>
  • Date: Tue, 26 Sep 2000 14:22:19 -0400

-----Original Message-----
From: ilechr@cbs.fiserv.com <ilechr@cbs.fiserv.com>
To: RPG400-L@midrange.com <RPG400-L@midrange.com>
Date: Tuesday, September 26, 2000 12:03 PM
Subject: SQL processing in RPG programs


>
>
>Gentlemen and gentlewomen,
>
>At our company the tradition has always been to use embedded SQL for
retrieving
>data from SQL tables for use in RPG programs.
>
>When I asked why the good old fashioned F spec and opcodes SETLL, CHAIN etc
were
>not used the response was that null capable fields in the SQL tables made
this
>an unreliable method to adopt.


That's a nice answer, but the wrong one (IMNSHO).

The REASON to use SQL instead of RPG ops, is to code independently of
database changes and to force some operations(like group by and sum) down
into the database manager (in liew of say OPNQRYF or more RPG code). If the
SQL is coded to select the required fields and not just a blind select *,
then any changes to the database are not reflected in having to recompile
the world, just to add a field, and you can still map the fields from the
external descriptions.

Yes, you can add the field and turn off level checking, but that is
different.

Another possible answer may lie in a question.... when was the switch made?
What version and release? Unless my alzheimer's is acting up, nulls hit the
database before RPG could deal with them. Then you might have had a valid
answer...


===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - AS/400 Administrator
 -- IBM Certified Specialist - RPG IV Developer

"Those who would give up essential Liberty,
  to purchase a little temporary Safety,
  deserve neither Liberty nor Safety."

     - The Papers of Ben Franklin



+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 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.