GeneCampbell
IS-IT--Management
I am trying to parse a table name from a field in a teradata table, pass the table name to a variable and use the variable to populate the table name in a select statement.
Is this possible?
create procedure core_proddb_s.table_nme2( in p1 int )
begin
Declare var1 char(50);
select table_name into:var1 from core_workdb.load_parameter where campaign_id=1;
insert into core_workdb.opportunity_test
select * from :var1;
End;
Is this possible?
create procedure core_proddb_s.table_nme2( in p1 int )
begin
Declare var1 char(50);
select table_name into:var1 from core_workdb.load_parameter where campaign_id=1;
insert into core_workdb.opportunity_test
select * from :var1;
End;