RPG SQL Precompiler Feedback

RPG SQL Precompiler Feedback

Post by Kent Milliga » Sat, 09 Jun 2001 06:54:51



 VOTE NOW! HELP DECIDE NEW FEATURES FOR THE ILE RPG SQL PRECOMPILER
IBM is planning which features to add to the SQL/400 precompiler for
ILE RPG. The precompiler is part of the DB2 Query Manager and SQL
Development Kit licensed program product. The precompiler translates
RPG IV source code members that contain embedded SQL statements as the
first stage in creating a module or program object. If you use SQL
with ILE RPG, you have a major interest in what enhancements IBM
includes in future releases.

IBM has asked Club Tech to help them learn customers' preferences.
After reading the information below, here's how you can provide IBM
your input:

-- Cast your vote: Rate the importance of each enhancement IBM is
currently considering. Go to the following site to vote:

http://www.as400network.com/as400surveys/SQLPrecompiler

-- If you have additional suggestions or comments, send an e-mail to

-- To engage in a more extensive discussion of potential enhancements,
participate in the AS400Network SQL/400 and Database Web forum. Look
for the thread titled "ILE RPG SQL Precompiler Enhancements" at

http://www.as400network.com/Forums/Thread.cfm?CFApp=59&Thread_ID=2100... .

Here are the enhancements currently under consideration:

a. Full support for properly parsing RPG subprocedures

The current version of the SQL precompiler doesn't properly parse some
source members that have subprocedures. For example, O-specs may cause
an erroneous "out of sequence" error. This enhancement would have the
SQL precompiler properly parse source members with subprocedures.

b. Support for using a local variable in a subprocedure as a host
variable in an SQL statement

RPG IV lets you declare a local variable within a subprocedure. A
local variable can have the same name as a global variable or a local
variable in a different subprocedure. The current version of the SQL
precompiler doesn't properly handle scoped variables. This enhancement
would have the SQL precompiler support the same variable scoping rules
as the ILE RPG compiler. For example, if you had global variable X and
local variable X in the subprocedure P, any embedded SQL statement
within P that referred to :X would be treated as referring to the
local variable.

c. Full support for the V5 qualified subfield names based on the new
RPG IV D-spec Qualified keyword

The new RPG IV Qualified keyword lets you have a data structure
subfield with the same name as a subfield in a different data
structure or as a stand-alone variable. A subfield of a data structure
with the Qualified keyword must be referenced using the data structure
name to qualify the subfield name (for example,
MyStructure.MySubfield). This precompiler enhancement would allow the
use of qualified subfields as host variables in an embedded SQL
statement.

d. Conditional precompilation: /If, /Define, and other directives

The RPG IV compiler directives, /If, /Else, /ElseIf, /EndIf, /Eof,
/Define, and /Undefine, support conditional compilation of source
code. The current version of the SQL precompiler doesn't recognize
these directives and unconditionally processes all of the source
member. This enhancement would have the SQL precompiler support these
directives.

e. Nested /Copy

The RPG IV compiler allows a /Copy source member to contain a /Copy
directive. The current version of the SQL precompiler doesn't allow
nested /Copy directives. This enhancement would have the SQL
precompiler support nested /Copy directives.

f. Support for /Include

The RPG IV compiler allows the /Include directive as a synonym for
/Copy. The current version of the SQL precompiler ignores /Include
directives. This enhancement would have the SQL precompiler support
/Include directives. (The /Include directive was introduced as a
workaround for the lack of SQL precompiler support for nested /Copy
directives. A /Copy member could contain an /Include directive, and
the SQL precompiler would process the one level of /Copy and ignore
the nested /Include. If precompiler support is added for nested /Copy,
/Include becomes superfluous.)

g. Support for host structure in Update statements

The current version of the SQL precompiler lets you specify a data
structure in place of a list of host variables in the Select Into,
Fetch, and Insert statements. The precompiler treats a data structure
as if you specified a list of the subfields within the data structure.
This SQL/400 extension can simplify coding and improve performance in
some situations. This precompiler enhancement would let you specify a
data structure in an Update statement as well. For example, you might
code the following: Update T Set Row = ( :MyStructure )

h. Support for a structure of host indicator variables

When you specify null indicators along with a host structure, the
current version of the SQL precompiler requires you to specify an
array of indicators. Indicator arrays don't provide meaningful null
indicator variable names; for example, the null indicator for the
CustAddress host variable might be CustInd(5). This precompiler
enhancement would let you specify a data structure for the host
indicators. With this enhancement, the null indicator for the
CustAddress host variable might be a subfield named CustNameInd or,
using a V5 qualified subfield name, CustInd.Address.

i. A precompiler directive to generate an array (or structure) of
indicator variables from a data structure

The ILE RPG compiler lets you define an externally-described data
structure, which can then be used as a host structure name in SQL
statements. Currently, there is no way to automatically generate a
corresponding host indicator array. This requires hand-coding and
complicates maintenance. This enhancement would let you specify a SQL
precompiler directive to generate an array with one indicator variable
for each subfield in a referenced data structure, thus automating the
process. If precompiler support is added for a structure of indicator
variables (as described in the previous item), this enhancement would
also support a directive to generate a data structure with one
indicator variable for each subfield in a referenced data structure.

If you have other recommendations for enhancements to the ILE RPG SQL
precompiler, send them to the e-mail address listed above or post them
in the Web forum.

--
Kent Milligan, DB2 & BI team
PartnerWorld for Developers, iSeries

(opinions stated are not necessarily those of my employer)

 
 
 

1. Q: SQL precompiler for DB2/400 on Unix?

I have an application running on HPUX 9.04 with access to a local
Informix database by way of the Informix ESQL/C precompiler. Is there a
similar product which will allow me to recompile my application on the HP to
access a remote DB2/400 database over TCP/IP?

Thanks.

Edwin Babadaglian

2. Display of "?" and Hex conversion

3. RPG I/O feedback area for Join Logicals

4. ????? ?????? ??????? ?????????? ??????? ????? ?? ?????????

5. Requesting Feedback about Products that Convert RPG to Java

6. asynchronous sampling

7. ILE RPG and SQL without the Imbedded SQL Product?

8. network management conference

9. Any feedback Client Access Express

10. COBOL Open and I-O Feedback Copybooks published.

11. Looking for feedback on SignOn 400

12. JBA System 21 feedback?