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