I was going to add that SELECT * may well fail above if you are looking at an empty table - I'm not sure.
If you are creating the tables anyway - why not store all the names/types on creation?
If you are creating the tables anyway - why not store all the names/types on creation?