Skip to Content
0
Nov 01, 2018 at 07:44 PM

Change Temporary Table Column Name

175 Views

Dear Experts

I have a case that I need your valuable help in.

I have create and two global temporary table with two column.

1. create global temporary table TT ( Rec varchar(10), Mont Varchar(50));

2. create global temporary table TT1 ( Rec1 varchar(10), Mont1 Varchar(50));

I have insert some values in both tables.

now I need to change the first table column name within a special condition from the second temporary table.

I used rename column and it work properly

execute immediate ( 'rename column TT.Rec to HI')

but if used for example the following it will not work

execute immediate ( 'rename column TT.Rec to tt1.Rec1 where Mont1 =1')

it will not work.

is it possible to change the table column name within a parameter from another table.

thanks in advanced