Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert column name & values dynamically from one table to another.

suhaibegJul 29 2009 — edited Jul 29 2009
how 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,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2009
Added on Jul 29 2009
9 comments
2,509 views