| 
 | 
Lo, add a struct for null fields even if there are no
null capable fields.  Then reference this struct on the
fetch statement:
 _Packed struct host_struct {
    _Packed struct {
       short AOWL1_LEN;
       char AOWL1_DATA[2];
     } AOWL1;
    _Packed struct {
       short AOWL2_LEN;
       char AOWL2_DATA[1];
     } AOWL2;
   } AOW[10];
struct {
  short inds[2]; /* number of fields in host_struct */
   } AOW_inds[10];
EXEC SQL include SQLCA;
main()
  {
    EXEC SQL
      declare CURSOR c1 for
        select aow1, aow2 from file;  /* made this up */
    EXEC SQL
      open c1;
    EXEC SQL
      fetch from c1 for 10 rows into :AOW:AOW_inds;
    return;
  }
In debug, you should be able to see that all elements
have data: eval AOW[1], eval AOW[2], etc.
Phil
> That's exactly what I did try. As you say, it does work - that is, until you
> refer to AOW as a result set. Then precompiler starts generating SQL5011.
>
> Lo
>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.