Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
What is the best way to rename programmatically all fields in a given table with a "xx_" prefix related to the table name (but not the table name itself - and therefore not an alias or QUALIFY statement)?
Thanks!
Hi Rob,
Thank you! now it is working, however since I have also some fields w/o blank spaces, i got a error message because the name already exists. Anyway to modify the loop to replace blank spaces ONLY for those fields with blank spaces?
Many thanks!
Hi Rob,
I implemented this changes and now is working 🙂
For fieldIdx = 1 to NoOfFields('TempTable')
LET vFieldname =FieldName($(fieldIdx), 'TempTable');
LET vFieldBlankCount=SubStringCount('$(vFieldname)',' ');
LET vFieldnameModified =if('$(vFieldBlankCount)'>0,Replace('$(vFieldname)', ' ' ,'_'),'');
RENAME Field [$(vFieldname)] TO $(vFieldnameModified);
// LET vFieldname= null();
// LET vFieldnameModified = null();
Next fieldIdx