Midrange News for the IBM i Community


Posted by: John Dowling
Milford, Ma
over ride a field name
has no ratings.
Published: 23 Jan 2013
Revised: 23 Jan 2013 - 1766 days ago
Last viewed on: 24 Nov 2017 (2668 views) 

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.

over ride a field name Published by: John Dowling on 23 Jan 2013 view comments(1)

I have the need to modify the item number (drop the leading blank if there is one) in about 40-50 files. the program is a simple one, but I don't want to write 40-50 programs. I know I can override a db file and call the same program, but is there a way i can override the field name (itema, itemd, itmnum, ect) thanks

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: over ride a field name
Posted: 4 years 10 months 23 hours 34 minutes ago

Use embedded SQL.

myFix = 'UPDATE ' + %trimR(fileName) + ' SET ' + %trimR(fieldName) + '= trim(' + fieldName + ')';
EXEC SQL EXECUTE IMMEDIATE :myFix;