Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Use embedded SQL.
myFix = 'UPDATE ' + %trimR(fileName) + ' SET ' + %trimR(fieldName) + '= trim(' + fieldName + ')'; EXEC SQL EXECUTE IMMEDIATE :myFix;