Automating queries using ODBC, subqueries

Database

Automating queries using ODBC, subqueries

I have a large (~150, and the list changes completely every week) list of queries that I need to audit. Due to policies/ other constraints, I can't use BTEQ or stored procedures, I have to use ODBC. I have permission to create temp tables.

The catch is that many of these queries contain select *s, which occassionally cause field duplication errors when putting output into temp tables/ subqueries, even though there is no problem running the queries in teradata sql assistant. Even though this is bad style and should probably not be permitted as a matter of project policy, that is not something i can change.

My question is this: is there a way of automating the process of replacing select * with enumerated fields, or is there some other way to create a temp table, and have it ignore/rename duplicate fields?

Or, am i better off taking a completely different approach?