|
Continuing education:
I am attempting to update a file (table) in embedded SQL in RPG, with
built-up variables:
D UpdateOne S 500A INZ('Update -
D $AUDITSTG/SAVHISTORY ')
// Define SET statement
if JRFNAM <> #S3FNAM;
Set = Set + ' JRFNAM = ''' + #S3FNAM + ''' ';
endif;
if JRVOL <> #S3VOL;
Set = Set + ' JRVOL = ''' + #S3VOL + ''' ';
endif;
if JRSEQ <> #S3SEQ;
Set = Set + 'JRSEQ = ' + #S3SEQ + ' ';
endif;
if JRSSIZ <> #S3SSIZ;
Set = Set + 'JRSSIZ = ' + #S3SSIZ + ' ';
endif;
if JRNOTE <> #S3NOTE;
Set = Set + ' JRNOTE = ''' + #S3NOTE + ''' ';
endif;
// update record...
SelectTwo = Update + Set
//********************************************************************
// $UPDATE - Update Current Record
*
//********************************************************************
begsr $UPDATE;
/END-FREE
C/EXEC SQL
C+ <------------ (What is the proper way to build this statement?)
C/END-EXEC
/FREE
endsr;
I'm attempting to update only the fields that change. When I attempt to
use a variable, it says that the "Token" was not valid.
TIA
Dave
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.