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



Right, Alan

The original embedded SQL is seen by the pre-compiler - a pre-compiler takes some code with special characters and converts it into true source code for the language in question.

Here the original code is commented out but present, to see what is being done. The code after this is working with variables that are listed in I-specs up higher in the code. These start with SQL and then have a 3-digit number - we have SQL005 and SQL006 here - these correspond to the BOL2DH and COUNT(*) in the SQL statement, resp., is my guess.

SQLRT is probably the SQL run-time - RT for run-time - and it is called for every statement you put into the program. I've never looked at SQLCA, but I suspect that has some of the statement stuff. One element, SQLER6, is set to -4, which I've always thought identified some operation or such. I really don't know.

But this makes sense to me - HTH
Vern

Now this is just normal RPG - it IS the true source that is used to compile the program. It does have extra stuff, which may allow for the different SQL display types in STRDBG.

As I replied in another thread here, change the output location for the generated source - this lets a person keep the source in a permanent location instead of QTEMP.

Vern

On 11/30/2011 10:07 AM, Alan Campin wrote:
If I understanding the question correctly the text is only seen by the
pre-compilier which converts to rpg calls. The SQLRT are the SQL calls.

On Wed, Nov 30, 2011 at 8:42 AM, Steve Richter<stephenrichter@xxxxxxxxx>wrote:

When CRTSQLRPG runs it places the converted SQLRPG -> RPG code in a srcmbr
in QTEMP/QSQLTEMP. When I look at the QSQLTEMP code I don't see the text of
the sql instructions. Just a call to SQLRT.

How is it I can compile and run the source in QSQLTEMP without the sql
instruction text being passed to any of the SQL processor programs?

this is the rpg code in QSQLTEMP that runs the SQL instruction:

C*EXEC SQL
C* SELECT COUNT(*)
C* INTO :VCOUNT
C* FROM BOLMSTRH
C* WHERE BOL2DH = :VBOL2D
C*END-EXEC
CL0 Z-ADDVBOL2D SQL005
CL0 Z-ADD-4 SQLER6 1
CL0 CALL SQLRT
CL0 PARM SQLCA
CL0 PARM SQL000
CL0 SQL004 IFEQ '1'
CL0 Z-ADDSQL006 VCOUNT
CL0 END
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.