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



Did you check the SQLCOD or SQLSTT after each SQL statement?
If SQLCOD < *Zeros an error occurred.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Stijn Peeters
Gesendet: Wednesday, 10. March 2010 15:26
An: rpg400-l@xxxxxxxxxxxx
Betreff: SQLRPGLE problem

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

Replies:

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.