|
----- Message from Stephen Coyle <stephenfcoyle@xxxxxxxxx> on Wed,<RPG400-L@xxxxxxxxxxxx>
18 Apr 2018 13:49:36 -0400 -----
To:
"RPG programming on the IBM i (AS/400 and iSeries)"
open,
Subject:
SQLRPGLE Update Dynamic Filename using WHERE CURRENT OF
HI All,
Need some help with this as I cannot find an example.
I have a filename that is input as a parm.
I prepare the sql statement with the variable filename, then declare,
fetch/update loop and close.to
Now when I update the current record all samples I have seen are using a
hard coded filename.
I believe I could get around with a sql execute immediate but would like
stick with WHERE CURRENT OF.throws
Any help appreciated.
Here are the relevant bits....It's the 'Update @FileName' below that
me off.
DCL-S SelectSQL Like(StdLTxtVar)
Inz('Select keyValues from &1 FOR UPDATE OF
TOKEN');
// Replace marker with file name
SelectSQL = %ScanRpl('&1' :@FileName :SelectSQL);
exec sql
Prepare S1 from :SelectSQL;
exec sql
declare C1 cursor for S1;
exec sql
open C1;
exec sql
fetch next from C1 into :KeyValues;
WrkToken = xmlTransaction(keyValues :Mode :@LoadName :groupID);
exec sql
Update @FileName
Set Token = :WrkToken
WHERE CURRENT OF C1;
Thanks in advance...
- Steve
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.