× 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: RE: Null indicator with FETCH for N ROWS WAS: SQL pre-compiler
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Wed, 28 Jul 1999 09:44:59 -0400

The precompiler seems very fussy regarding the null indicator definitions.
You can't declare the indicator array as anything but an array of type
SMALLINT, and the number of elements must exactly match the number of fields
in your FETCH.  Any discrepancy and the precompiler will reject the null map
with the SQL5011.  I use the "I" datatype out of habit nowadays, because the
"B" datatype will truncate large numbers.  It should work just fine as 4b 0.

For an example of how strict the precompiler is, this gives an SQL0511:
DRtnNullRaw       ds                  occurs(10)         
D NullMap                        5i 0 dim(9)             
D TblLibNull                     5i 0 overlay(NullMap:01)
D TblNameNull                    5i 0 overlay(NullMap:05)
D TblTypeNull                    5i 0 overlay(NullMap:09)
D TblTextNull                    5i 0 overlay(NullMap:13)
D ColNameNull                    5i 0 overlay(NullMap:17)
D ColTypeNull                    5i 0 overlay(NullMap:21)
D ColLenNull                     5i 0 overlay(NullMap:25)
D ColScaleNull                   5i 0 overlay(NullMap:29)
D ColTextNull                    5i 0 overlay(NullMap:33)

apparently because of the presence of any fields other than the array.

This works:
DRtnNullRaw       ds                  occurs(10)
D NullMap                        4b 0 dim(9)    

As for PTF's, try the latest database group ptfs: SF99103.  I am on V4R3M0,
cume 99054 (way back!)

Buck Calabro
Billing Concepts Albany, NY
mailto:mcalabro@commsoft.net

> -----Original Message-----
> From: Nelson C. Smith 
> Sent: Tuesday, July 27, 1999 10:32 PM
> To:   RPG400-L@midrange.com
> Subject:      Re: Null indicator with FETCH for N ROWS   WAS: SQL
> pre-compiler
> 
> Wow!  That's exactly what I'm trying to do, Buck.  But I can't get the
> RtnNullRaw DS past the precompiler.  I keep getting the dreaded SQL5011
> error.  Did you ever get this error?  It occurs right on the Fetch
> statement
> in the precompiler.  When I star-out the null-capable fields and thus the
> need for the indicator host variable, the procedure works fine.
> 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  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.