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


  • Subject: Null fields in SQLRPGLE.
  • From: Marco Facchinetti <facchinetti@xxxxxxxxx>
  • Date: Wed, 4 Oct 2000 07:02:36 -0700 (PDT)

I'm here again...

I made this just to test what happen (the field ABDTINIRAP
is null capable filed and is usually null):

H DATFMT(*EUR) ALWNULL(*USRCTL)                            
D DBANA0        E DS                  EXTNAME(DBANA00F)    

D NUL             S              4                         
dind_array        ds                                       

d inds                           4B 0 dim(50)              

D*----------------------------------------------------* 
SQL                
C/EXEC SQL                           
C+ DECLARE CUR CURSOR FOR
C+ SELECT * FROM DBANA02L                              
C+ ORDER BY ABRAGSOC1E                               
C/END-EXEC                                            
c*
C/EXEC SQL                                   
C+ OPEN CUR                                              
C/END-EXEC                                         
 c*                                                        
               
 C     1             DO        11                          

 C/EXEC SQL                                               
 C+ FETCH CUR INTO :DBANA0 :INDS                      
 C/END-EXEC                                             
 c                   except    riga                       
 C                   IF        SQLCOD=100 OR
SQLSTT='020000'
 C                   LEAVE                             
 C                   ENDIF                                
I cannot use this form......
 C*                  IF        %NULLIND(ABDTINIRAP)=*ON 
 C*                  EVAL      NUL ='*ON'               
 C*                  ELSE                            
 C*                  EVAL      NUL ='*OFF'           
 C*                  ENDIF                     
I must write (I know it's INDS(21) from compiler listing )
 C                   IF        inds(21)=-1        
 C                   EVAL      NUL ='*ON'               
 C                   ELSE                            
 C                   EVAL      NUL ='*OFF'           
 C                   ENDIF                     

 C                   ENDDO     
 c*                                      
 C/EXEC SQL                                          
 C+ CLOSE CUR                                          
 C/END-EXEC                                             
 c                   eval      *inlr=*on               
 c                   return                 
 ******************** End ******************************** 

Please do not comment the code, I know it's not perfect. 

I like the way the pre-compiler handles and generate the
code form the "*" syntax and the ds since is working even
if I add or eliminate some fields from the file DBANA00F.
But this is not true anymore since I'm forced to identify
the SQL %nullind whit an array and (of course) a fixed
index.
Any way out?
(please don't tell me to select only the collums I need)



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.