|
Hi all
In a RPG program execute SQL : below what i do:
when i run the program i receive SQL Error 22002 An indicator variable is
required.
Where am i wrong ? how can solve this error ?
Dcl-Ds MainDs;
xAnnoc Char(2);
xMesec Char(2);
xImpo Packed(30:9);
End-Ds;
mainStatement = ' SELECT '
+ ' Substr(xdtr, 1, 2), '
+ ' Substr(xdtr, 3, 2), '
+ ' SUM((xqty * (prc - xsc) ) * §CSEG ) AS impo '
+ ' FROM myfile m '
+ ' left join myile 2 t '
+ ' on xcax = §cax '
+ ' Group by substr(xdtr, 1, 2) , substr(xdtr, 3, 2)'
+ ' order by substr(xdtr, 1, 2) , substr(xdtr, 3,2)';
ExEC SQL
FETCH NEXT FROM mainCursor INTO :MAINDS ;
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.