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



Dear Rob,


        SQLRPGLE - Program with Multiple 'Select' Statements group.

As you have suggested, I am trying to work with temporary table concept
available with the 'with' Clause.   Which is giving an error, even though
the table has a field in that name it says not valid,  I am not able to
guess, what could be the problem, 

My sample program code is here.....(This is just a sample code is given does
may not have any meaningful 'Select' constructs)

0001.00 C/EXEC SQL                                                         
0002.00 C+ Declare CURS1 CURSOR FOR                                        
0004.00 C+ WITH T1 AS (SELECT F1.SNAME, COUNT(F2.CNUM) AS CCUS             
0010.01 C+             FROM SALPEP F1 JOIN CUST F2 ON F1.SNUM = F2.SNUM)   
0010.04 C+ SELECT SNAME, CCUS FROM T1                                      
0010.06 C+ ORDER BY SNAME                                                  
0018.00 C/END-EXEC                                                         
0019.00 C                                                                  
0020.00 C/EXEC SQL                                                         
0021.00 C+ OPEN CURS1                                                      
0022.00 C/END-EXEC                                                         
0023.00 C                                                                  
0024.00 C/EXEC SQL                                                         
0025.00 C+ CLOSE CURS1                                                     
0026.00 C/END-EXEC                                                         

The spool display of the error part is like this......

MSG ID  SEV  RECORD  TEXT                                                 
SQL0122  30       3  Position 31 Column SNAME or expression in SELECT list
                     not valid.                                           
                    Message Summary                                       
  Total     Info   Warning      Error   Severe  Terminal                  
      1        0         0          0        1         0                  
30 level severity errors found in source                                  

        Could you please guide me in this regard,

Sriram Srinivasan
IMPORTANT NOTICE: 

The information in this email (and any attachments) is confidential. 
If you are not the intended recipient, you must not use or disseminate the
information.
If you have received this email in error, please immediately notify me by
"Reply" command 
and permanently delete the original and any copies or printouts thereof. 
Although this email and any attachments are believed to be free of any virus
or 
other defect that might affect any computer system into which it is received
and opened, 
it is the responsibility of the recipient to ensure that it is virus free
and no responsibility 
is accepted by American International Group, Inc. or its subsidiaries or
affiliates either 
jointly or severally, for any loss or damage arising in any way from its
use.

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.