Dimension table load - PLSQL question

  • From: Ranko Mosic <ranko.mosic@xxxxxxxxx>
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 28 Sep 2005 18:03:40 -0400

Hi,
requirement:
- input parameters are codes p_cd1, p_cd2, ...
- for these codes I get descriptions ( select descr1 into v_descr1 from
lkp_table1 where cd = p_cd1; select descr2 into v_descr2 from lkp_table2 where
cd = p_cd2 etc )
- check if table t has records  where t.descr1 = v_descr1
   and t.descr2 = v_descr2 and on and on ....;
- if row exists return primary key;
- if not then insert.

What is the best way of doing it ( simplest ) ?

Regards, Ranko.

Other related posts: