 
 -- Suppliers
 drop table x_mf purge;
-create table x_mf as
+create table x_mf nologging as
 with x as (
   select irs.concept_code_2 as q_code, mf.concept_name as q_name, r_drug.concept_code as r_code, r_drug.vocabulary_id as r_vocab
   from internal_relationship_stage irs 


-- Create equivalence between existing_concept_stage and future RxNorm Extension (complete_concept_stage)
drop table existing_to_complete purge;
create table existing_to_complete as
select e.concept_code as e_code, c.concept_code as c_code
from existing_concept_stage e
join complete_concept_stage c using(denominator_value, i_combo_code, d_combo_code, dose_form_code, brand_code, box_size, mf_code)


-- fast way to update codes require temporary tables. 
-- replace concept_stage
create table cs_rowid_update nologging as
select cs.rowid as irowid, xr.omop_code as concept_code from xxx_replace xr JOIN concept_stage cs ON cs.concept_code=xr.xxx_code;

merge into concept_stage cs
