Silly temp table question
Posted in 2007
Topics: SQL Development & Query Writing
Suppose I create a temp table by doing a SELECT ... INTO TEMP, joining columns from several disparate tables together. Once this temp table has been created, is there a relatively easy way to output the resulting temp table's schema? [As to the inevitable "Why would you want to?" question, the answer to that is long and involved -- suffice it to say I have a developer with a much different idea of how to debug stuff than what I have... ;) ]
On Nov 2, 11:11 am, Tom Girsch <tgir...@NOSPAM.gmail.com> wrote: > Suppose I create a temp table by doing a SELECT ... INTO TEMP, joining > columns from several disparate tables together. Once this temp table > has been created, is there a relatively easy way to output the resulting > temp table's schema? > > [As to the inevitable "Why would you want to?" question, the answer to > that is long and involved -- suffice it to say I have a developer with a > much different idea of how to debug stuff than what I have... ;) ] >From what front-end? If it's ESQL/C or a similar host language, you can PREPARE a SELECT * on the temp table and DESCRIBE it, then you will be able to walk the descriptor or sqlda structure and determine the types and lengths of the returned columns. Art S. Kagel