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



Hello,



I am experiencing a problem when programming an SQLRPGLE program.

I have copy pasted the code from an existing working program.

Below you can see a part of the code. The problem I'm having is that my
sql doesn't find any data.

But when I execute the SQL statement itself in SQL I do find data.

What can be the problem? I hope someone is willing to help me.

This is the first SQLRPGLE I have programmed. And I just don't know
where to look for the error.

Thank you in advance.



Kind regards

stijn



callp FcClearPf('fcpckblt');

open fcpckblt;

Query='SELECT phfirm, phwknr, phkdnr, phpck, phrout, pptrmt,
PPKLTN,' +

' phshpd FROM fckbph, fckbpp WHERE PHFIRM =''1'' and' +

' PHWKNR =''000'' and pHkdnr in (66666, 50033) and ppfirm
=' +

' phfirm and ppwknr = phwknr and pppck = phpck and pppcks
= 0' +

' and phShpd > 100301 and PhShpd < 100310';





//Query1 = %replace(%char(SeFrDt):Query:%scan('STR':Query):3);

//Query2 = %replace(%char(SeToDT):Query1:%scan('TO':Query1):2);





exsr select_data;



w_count = 0;

dow sqlcod = 0;

exsr fetch_data;

if sqlcod = 0;

write FCPCK1;

w_count = w_count + 1;

endif;

enddo;



exsr close_downl;



close fcpckblt;



if W_count = 0;

S1ERROR = 'No data selected';

exfmt rfmat01;

$SUBR = 'S9999';

// exsr s01;

else;

callp FcDownload('fcpckblt');

S1ERROR=('File fcpckblt created in dir. AS400 on General.');

exfmt rfmat01;

endif;




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.