I’m using RODBC for a database migration. I got a table in the origin, create a data frame and insert in the destination. This is working properly BUT in some cases the columns in the dest are in a different order (i dont know the order) and got an error for the data types. For example:
Col1 Col2 col3
A1. B1. C1
A2. B2. C2
In the destination I have:
Col3 Col1 Col2
I am doing a loop in dest for the colnames (because is the correct order ) and assign the content from orig;
Dest[,Col3] <- orig[,Col3]
And giving an error because dest has 0 rows. Do you have any idea how to solve it?