mewhittaker
New Member
This is my first post here, so I hope I haven't skipped any formality steps. I have searched on this subject but with no luck.
I want to be able to perform a For Each loop on every table in the database that has the field "company". Here is what I have so far:
DEF VAR tablelist AS CHAR.
FOR EACH _field
WHERE _field._field-name = "company",
EACH _file OF _field:
tablelist = tablelist + _file._file-name + ",".
END.
That gives me a list of comma-separated table names. How can I perform a FOR EACH loop on each table in that list? What I want to be able to do is change the value of "company" on all records in all tables that have that field. Ex:
FOR EACH tablename
WHERE tablename.company = "300":
tablename.company = "400".
END.
I want it to do that for every table in the list. Can it be done?
Thanks for any and all help.
I want to be able to perform a For Each loop on every table in the database that has the field "company". Here is what I have so far:
DEF VAR tablelist AS CHAR.
FOR EACH _field
WHERE _field._field-name = "company",
EACH _file OF _field:
tablelist = tablelist + _file._file-name + ",".
END.
That gives me a list of comma-separated table names. How can I perform a FOR EACH loop on each table in that list? What I want to be able to do is change the value of "company" on all records in all tables that have that field. Ex:
FOR EACH tablename
WHERE tablename.company = "300":
tablename.company = "400".
END.
I want it to do that for every table in the list. Can it be done?
Thanks for any and all help.