cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to retrieve temporary table structure?

Valdas
Participant
0 Kudos
1,121

Title kind of says it all, here is a sample query:

BEGIN
    DECLARE LOCAL TEMPORARY TABLE tmp(id INTEGER, val VARCHAR(20));
    SELECT * FROM sys.syscolumns WHERE tname = 'tmp';
END;

Any ideas?

View Entire Topic
Valdas
Participant

I found a workaround:

BEGIN
    DECLARE LOCAL TEMPORARY TABLE tmp(id INTEGER, val VARCHAR(20));
    SELECT * FROM sa_describe_query('select * from tmp');
END;
VolkerBarth
Contributor
0 Kudos

Nice, I just wanted to mentioned another answer - with exactly that solution.