03 Single SQL command dynamic with a parm

**FREE

dcl-s SQLStmt char(100) inz('Update FileA set FieldA = ');

dcl-pi *n;
       parm1 char(10);
end-pi;

SQLStmt = %trim(SQLStmt) + parm1;

exec sql execute immediate :SQLStmt;

if sqlstt <> '00000';
   // handle the error condition
else;
   // show how many records were updated
endif;

*inlr = *on;
           

Comments

Popular posts from this blog

07 Using CURSOR and FETCH into host DS

12 FETCH and sub-procedures