J
JimS
My client imports several data streams from a corporate system that outputs
excel or tsv or csv files. I have an import proecess in pretty good shape,
except corporate is forever changing the columns. Most often, they add
columns without telling my client. I use an "INSERT * from
ImportedTempTable..." SQL command to get the data where it belongs. I don't
need all the columns, but would prefer to import most of 'em. The Insert
statement errors out when the import table has more fields in it than the
target table.
So, I thought, why not compare the two tables' field lists and import only
the matches? Two issues:
1. Can you point me to an example of looping through the fieldname
collection on a (linked) table, so I can get up to speed on that quickly....
and,
2. What if the sum of the lengths of the field names, commas, square
brackets, etc. come to more than 256 characters (the longest string
variable)? How do I deal with that as I assemble the SQL command?
Jim
excel or tsv or csv files. I have an import proecess in pretty good shape,
except corporate is forever changing the columns. Most often, they add
columns without telling my client. I use an "INSERT * from
ImportedTempTable..." SQL command to get the data where it belongs. I don't
need all the columns, but would prefer to import most of 'em. The Insert
statement errors out when the import table has more fields in it than the
target table.
So, I thought, why not compare the two tables' field lists and import only
the matches? Two issues:
1. Can you point me to an example of looping through the fieldname
collection on a (linked) table, so I can get up to speed on that quickly....
and,
2. What if the sum of the lengths of the field names, commas, square
brackets, etc. come to more than 256 characters (the longest string
variable)? How do I deal with that as I assemble the SQL command?
Jim