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



Mark,

It's my understanding that this is a long-time gripe with the SQL
preprocessor.  It doesn't know how to use local storage in your procedure.

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-898-7863 or ext. 1863



> -----Original Message-----
> From: MWalter@hanoverwire.com [mailto:MWalter@hanoverwire.com]
> Sent: Tuesday, September 10, 2002 1:01 PM
> To: rpg400-l@midrange.com
> Subject: SQL problem
>
>
> Hello all,
>
> Could someone tell me why this datastructure is not usable:
>
>      PgetAllInvGlMf    B                   Export
>      DgetAllInvGlMf    PI              *
>      d numrecs                       10i 0
>
>      DdtaLen           S             10i 0
>      dcount            S             10i 0
>
>      DdsData         e DS                  extname(Invglmf)
> occurs(9999)
>      D                                      based(p_dsData)
>
>       * retrieve the number of records to be returned
>      c/exec sql
>      c+ select COUNT(*) INTO :count FROM Invglmf
>      c/end-exec
>       * only process if there are records
>      c                   if        count > 0
>       * allocate the storage for the MODS
>      c                   eval      dtaLen = %size(dsData) * count
>      c                   alloc     dtaLen        p_dsData
>       * declare the cursor
>      c/exec sql
>      c+ DECLARE c CURSOR FOR
>      c+  SELECT * FROM Invglmf
>      c/end-exec
>       * open the cursor
>      c/exec sql
>      c+ OPEN c
>      c/end-exec
>       * move the records from the cursor to the MODS
>      c/exec sql
>      c+ FETCH FROM c FOR :count ROWS INTO :dsData
>      c/end-exec
>       * close the Cursor
>      c/exec sql
>      c+ CLOSE c
>      c/end-exec
>       * set the records returned and return a pointer to the MODS
>      c                   eval      numRecs = count
>      c                   return    p_dsData
>       * no records, return null.
>      c                   else
>      c                   return    *null
>      c                   endif
>
>      P                 E
>
> The precompiler is telling me that dsData is not defined or available.
>
>
>
> Thanks,
>
> Mark
>
>
> Mark Walter
> Sr. Programmer/Analyst
> Hanover Wire Cloth a div of CCX, Inc.
> mwalter@hanoverwire.com
> http://www.hanoverwire.com
> 717.637.3795 Ext.3040
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>



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.