I\'m trying to insert data to a table from another table and the tables have only one column in common. The problem is, that the TABLE1 has columns that won\'t accept null value
For referential integtity :
insert into main_tbl (col1, ref1, ref2, createdby) values ('col1_val', (select ref1 from ref1_tbl where lookup_val = 'lookup1'), (select ref2 from ref2_tbl where lookup_val = 'lookup2'), 'init-load' );