× 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: RPG and SQL Compilers
  • From: Chris Bipes <chris.bipes@xxxxxxxxxxxxxxx>
  • Date: Mon, 1 Jan 2001 20:18:45 -0800
  • Organization: CrossCheck, Inc

Comments In-Line:
----- Original Message ----- 
From: <Jon.Paris@hal.it>
To: <RPG400-L@midrange.com>
Sent: Saturday, December 30, 2000 12:35 PM
Subject: RPG and SQL Compilers



 >> I understand what the precompiler does.  What I dont understand is why
it is necessary to have an SQL precompiler at all.

The precompiler gets your field definition from the file(s) used in the SQL 
statements just like the F specs in regular RPGxx.  The F specs brings in your 
field definitions as well as builds you access to the file by including 
subproceedures to process the file.  SQL just replaces the F specs and file I/O 
opt codes.

>>A much better solution would be to have RPG simply understand the "Start of
SQL stuff" and "End of SQL stuff" and to pass all the code between these
two to the SQL compiler.  The SQL processor would then compiles its code
"asking" the RPG compiler (via an API) for information on the size and type
of the host variables etc.  This way neither compiler has to know anything
about the other and each is free to implement whatever changes they like
with zero impact to the other.  This is closer to the method used in other
DB2 "flavors".


The SQL declare and select stuff would have to be defined at the top of the 
program, (like the F specs), to get all your fields into the program.  The 
cursor stuff would be placed through out the program where you would  normally 
use the read/update/add/delete opt codes.  OR the RPG compiler would read 
through the source looking for all the SQL statements, build the file I/O 
stuff, then take another pass to validate the rest of the program.  (Gee is 
that not what the SQL PreCompiler does?)

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