I'm trying to replicate select * into #temp from TestTable, which creates a temp table with the same column structure and column names.
I'm aware that the below code is possible,
temp = select * from TestTable;
but the column list is going to be dynamic so trying something like below,
temp = (Execute immediate 'select '|| lv_columnslist ||' from TestTable;');
How can I achieve that?