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



> From: oertlim@s054.aone.net.au (Matthias Oertli)
>  
>  Hi,
>  To embed SQL into RPG, is the SQL lic pgm required?
>  Is there any place that has example code (RPGIII & IV)?
>  Thanks,
>  Matthias

When we converted BPCS/36 to BPCS 405 CD with help from consultants Crowe 
Chizek http://www.crowechizek.com/ they use embedded SQL quite heavily in the 
RPG programs they modified for us & offered a class in this which I did not 
get a chance to attend, but I did get one of the hand-outs from their class - 
at the time SQL was a brand new programming language for me & later I got to 
go to the IBM class in SQL & UDB/400 which included about 1/2 day on SQL 
embedded in RPG & Cobol ... basically same examples were given in both RPG & 
Cobol ... that class also into triggers & very heavy DB rules - lot of 
different SQL topics to be covered in very few days.  IBM has now expanded 
their SQL education into 2 classes

S6137 sounds like it is thorough grounding in SQL other than this scenario 
... prerequisite for this class includes S6145
S6138 is heavy into embedded SQL in which RPG IV is used
Check out IBM course descriptions & schedules via links from 
http://www.training.ibm.com/ibmedu/spotlight/as400.html

I have found some useful threads in the AS/400 network forum on SQL & Data 
Base Programming & Query/400
http://www.as400network.com/Forums/Main.cfm?CFApp=59

So far the only embedded SQL that I have done is patterned after how Crowe 
Chizek did it ... using SQL instead of RPG CHAIN READ etc. to get at 
particular combinations of data.  If you want to read selected fields from 
several different files, SQL seems to be a more powerful way than traditional 
RPG & the READ mechanism of returning to the same command to get the next 
combination available works just as well as READ does, except READ just reads 
one record of one file & it is reading all fields of that file, while 
embedded SQL is picking & choosing individual fields from a whole bunch of 
files in one access.

I am not too keen on this feature, because of discomfort with making 
modifications, but you can read in a bunch of fields in a mathematical 
equation so that this field plus that field result divided by contents of 
third field (I prefer to test for zero in RPG code lines before any division) 
then multiplied by some faction end result is delivered to the RPG program.

Another area of hassle is performance statistics ... what do they all MEAN 
... I have one program that has hundreds of embedded SQL chunks & each one 
generates a bunch of lines of IBM analysis that is still pretty much Greek to 
me.  

Al Macintyre  ©¿©
http://www.cen-elec.com MIS Manager Programmer & Computer Janitor
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.