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



I know this is going to turn out to be something really lame that I'm simply missing, but bear in mind that I'm blind in one eye and wear glasses for the other one.

I don't do much embedded SQL (yet), but I have done a few but one I have been working on today simply will not compile. The reason being that it does not copy in the SQL Communications area. At first, I forgot that embedded SQL doesn't like subprocedures, but the manual straightened me out there. But the manual said that SQL could be embedded in either Detail or Total cals, or in a subroutine. So I moved the necessary code to a subroutine (below). Still no luck.

I included the pre-compiler listing, but it only had comments about the SET Options stuff, no errors.

The only errors in the ILE RPG listing are:

*RNF7030 30 050300 The name or indicator SQL_00000 is not defined.
*RNF7030 30 050300 The name or indicator SQL_00002 is not defined.
<etc.>
*RNF7030 30 050300 The name or indicator SQLCA is not defined.
*RNF7030 30 054000 The name or indicator SQLCLSE is not defined.
*RNF7030 30 052100 The name or indicator SQLCODE is not defined.

I re-compiled an existing, working program that is very similar (except that, being short and sweet, everything is in Deatil calcs.), and it compiled beautifully; the compile listing shows the SQL Communications area. I only use SQL in the one subroutine shown below. The $Group subroutine is, for what it's worth, called by another subroutine, which is called by another subroutine, which is invoked from Detail calcs.

That may be too much information, but I didn't want to omit anything that "might" have a bearing. So why is the program not compiling? (And if you want to comment upon my code, feel free as I'm always willing to improve.)

BEGSR $Group;
x = *Zeros;
@legend = 'Consolidation Code: ' + consCode + ' ' + @consDesc;
/end-free
C/EXEC SQL
+ SET Option
+ Naming = *Sys,
+ DatFmt = *ISO,
+ Commit = *None,
+ UsrPrf = *Owner
C/End-Exec
C/Exec SQL
+ Declare BidGroup Cursor for
+ Select
+ bqcust,
+ bqitm#,
+ bqpr,
+ bqxdat
+ from BIDQTE
+ WHERE bqcust in(SELECT arcust From ARMAST
+ WHERE arcons = :conscodePI)
+ for Read Only
C/End-Exec
C/Exec SQL
+ OPEN BidGroup
C/End-Exec
/free
DOW 1 = 1;
/end-free
C/EXEC SQL
+ FETCH Next from BidGroup
+ INTO :customerPI,:itemPI,:PricePI,:expdatePI
C/End-Exec
/free
IF sqlState = '02000'
OR sqlCode < *Zeros;
LEAVE;
ENDIF;
<do stuff with the -PI data elements>
ENDDO;
/end-free
C/EXEC SQL CLOSE BidGroup
C/end-exec

Thanks.

Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.