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



Hi,

As Scott pointed out it is possible to use SQL Free Format on a machine with
release V5R4 and down compile it to release V5R2. The compiled code will run
on a machine with either release V5R2 or V5R3.

You *do* have to use SQL statements that are supported on the target
release (i.e. if you use a new SQL keyword that
requires V5R3, you'd have a problem).

The problem is, if you use a keyword or scalar function in embedded SQL that
is only supported for release V5R3 or V5R4 and downcompile your program to
V5R2, compilation will not fail! But the compiled program will fail if you
move it to a machine with a lower release (i.e. V5R2). I already run into
this problem for several times and after having installed the programs on a
clients machine.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Scott Klement
Gesendet: Monday, October 08, 2007 07:19
An: RPG programming on the AS400 / iSeries
Betreff: Re: Free form SQL


Hi Pete,

Actually, I think Vern is wrong. You *can* use TGTRLS(*PRV), as long as
you're using an SQL precompiler that supports free-format.

Remember what the precompiler does! It converts your code into calls to
SQL APIs, then compiles that code. It doesn't matter whether your
original code is fixed or free, in either case, it converts your code to
fixed format calls to the APIs (it'll insert /end-free and /free as
appropriate, providing you have the latest PTFs... there were bugs in
the original implementation that caused the /end-free to be misplaced in
certain circumstances, but these are fixed in the latest PTFs -- make
sure you have the ones that supercede the original ones, don't just pick
the ones from the APAR)

Anyway.. the point is, the code that the precompiler creates will work
with TGTRLS(*PRV), no problem -- so it doesn't matter whether you use
TGTRLS(*PRV) or not. You *do* have to use SQL statements that are
supported on the target release (i.e. if you use a new SQL keyword that
requires V5R3, you'd have a problem). (But that would be a problem in
either fixed or free format.)

The only flaw in free-format SQL on V5R3 (that I'm aware of) is that the
syntax checker in WDSC 7.0 reports a strange error on free-format SQL
statements. (Something about a connection error, which it turns out had
nothing to do with what was wrong, what was really wrong was that the
RPG syntax checker in V5R3 didn't support free-format SQL.) Not sure if
they ever fixed that problem.

But that's only a problem in the editor. The precompiler and compiler
should work fine (assuming you have the right PTFs applied) even with
TGTRLS(*PRV).

Pete Helgren wrote:
However, your pointer on *PRV probably saved me much time since I
would
have never thought to compile *CURRENT (*PRV is the default) and would
have chased my tail even further.

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