× 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 have begun this whole ordeal in hopes of getting down the issue of 
embedding sql statements in my rpg code, I think in the long run it will 
make life much easier.

However, I have not been able to figure out what I am doing wrong with the 
following code, it is supposed to extract the soldto number (cust no) and 
print it in the report.  The field in the externally described report is 
prtcustno....if anyone would be so helpful as to point out what I am doing 
wrong I would greatly appreciate it.

 C     *USA          MOVE      '06/01/2005'  SDATE
 C     *USA          MOVE      '06/30/2005'  EDATE
 C/EXEC SQL                                       
 C+ DECLARE CUSTCURSOR CURSOR                     
 C+ FOR SELECT ILNSOLDTO                          
 C+ FROM INVMARGIN                                
 C+ WHERE ILNINVDATE >= :SDATE AND                
 C+ ILNINVDATE <= :EDATE                          
 C/END-EXEC                                       
 C                   WRITE     HEADINGS           
 C/EXEC SQL                                       
 C+                  OPEN      CUSTCURSOR         
C+                  OPEN      CUSTCURSOR 
C/END-EXEC                               
C/EXEC SQL                               
C+ FETCH NEXT                            
C+ FROM CUSTCURSOR                       
C+ INTO :PRTCUSTNO                       
C+                                       
C/END-EXEC                               
C                   WRITE     DETAILLINE 
C/EXEC SQL                               
C+ CLOSE CUSTCURSOR                      
C/END-EXEC                               
C                   EVAL      *INLR = *ON
C                   RETURN               

If you bought, it was hauled by a truck - somewhere, sometime.


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.