How to insert column name & values dynamically from one table to another.
suhaibegJul 29 2009 — edited Jul 29 2009how can i insert the Column Name, Values & Primary key into another table if value is null then the record will not be inserted to another table.
Fro Example I have following two tables. Temporary & Transaction. I want transfer data of Temporary table into Transaction in such a way that If there is value in any column of temporary table then the Primary key, column & values of that particular column should be inserted into transaction table with primary key, column Name & its value. Record having column with null value should be ignored.
create table temporary
( pkr_id number(9),
col_1 number(4),
col_2 number(4),
col_3 number(4)
);
create table transaction
( record_pkr_id number(9),
column_name varchar2(5),
volumn_value number(4)
);
please help me in this regard.
Thanks,