 
 -- 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 

drop table dss_rowid_update purge;

-- replace packs in pack_content
create table pcs_rowid_update as
select pcs.rowid as irowid, xr.omop_code as pack_concept_code from xxx_replace xr join pack_content_stage pcs on pcs.pack_concept_code=xr.xxx_code;

merge into pack_content_stage pcs


-- 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
