Hi
Try compiling it with commit(*NONE)
Martin
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Stijn Peeters
Sent: 10 March 2010 14:26
To: rpg400-l@xxxxxxxxxxxx
Subject: 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;
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--------------------------------------------------------
This message (including any attachments) is only for the use of the person(s) for whom it is intended. It may contain Mattel confidential and/or trade secret information. If you are not the intended recipient, you should not copy, distribute or use this information for any purpose, and you should delete this message and inform the sender immediately.
Mattel UK Limited is incorporated in England and Wales with its registered office at Mattel House, Vanwall Business Park, Vanwall Road, Maidenhead, Berkshire SL6 4UB. Company Registration Number 1471442.
As an Amazon Associate we earn from qualifying purchases.