|
This is the entire source member: D/copy *libl/qrpglesrc,invglmfpr dinputData e DS extname(invGlmf) based(p_input) D prefix(ip_) DdsData E DS occurs(9999) based(p_dsData) d extname(invglmf) PgetAllInvGlMf B Export DgetAllInvGlMf PI * d numrecs 10i 0 DdtaLen S 10i 0 dcount S 10i 0 * 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 * INsert a record P E PaddInvGlMf B export DaddInvGlMF PI 10i 0 D ptrToData * const d stmt S 500 varying DQT C CONST('''') * set the pointer of the work structure to the new data c eval p_input = ptrToData * build the statement c eval stmt = 'INSERT INTO Invglmf + c (comno,tcode,itcls,rctacct,matacct, + c labacct,ovhacct) VALUES(' + c %editc(ip_comno:'X') + ',' + c QT + ip_tcode + QT + ',' + c QT + ip_itcls + QT + ',' + c QT + ip_rctacct + QT + ',' + c QT + ip_matacct + QT + ',' + c QT + ip_labacct + QT + ',' + c QT + ip_ovhAcct + QT + ')' * execute it c/exec sql c+ EXECUTE IMMEDIATE :stmt c/end-exec c return sqlcod * update a record P e PupdInvGlMf B export DupdInvGlMf PI 10i 0 D ptrToData * const Dstmt S 500 varying DQT C const('''') * set the pointer of the work structure to the actual data c eval p_input = ptrToData * build the statement C eval stmt = 'UPDATE Invglmf + C SET (rctacct, matacct, + C labacct, ovhacct) = (' + C QT + ip_rctacct + QT + ',' + C QT + ip_matacct + QT + ',' + C QT + ip_labacct + QT + ',' + c QT + ip_ovhAcct + QT + ')' + C ' WHERE tcode = ' + C QT + ip_tcode + QT + C ' AND itcls = ' + C QT + ip_itcls + QT + C ' AND comno = ' + C %editc(ip_comno:'X') * execute it c/exec sql c+ EXECUTE IMMEDIATE :stmt C/end-exec C return sqlcod * delete a record P E PdltInvGlMF B Export DdltInvGlMf PI 10i 0 D tcode 2 const D comno 2 0 const D itcls 4 const dstmt S 500 varying DQT C const('''') * build the statement C eval stmt = 'DELETE FROM Invglmf + C WHERE tcode = ' + c QT + tcode + QT + C ' AND comno = ' + C %editc(comno:'X') + C ' AND itcls = ' + C QT + itcls + QT * execute it C/exec sql c+ EXECUTE IMMEDIATE :stmt c/end-exec c return sqlcod P e If I remove the updInvGlMf and dltInvGlMf, it will compile. 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-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.