*/

*/

/*

*/ MERGE INTO cera2.institute i USING ( SELECT

FROM cera2_temp.institute) ni ON (i.institute_id = ni.institute_id) WHEN MATCHED THEN UPDATE SET

WHEN NOT MATCHED THEN INSERT (

VALUES (

/*

*/ MERGE INTO cera2.person p USING (

ON (p.person_id = np.person_id) WHEN MATCHED THEN UPDATE SET

WHEN NOT MATCHED THEN

/*

*/ insert into summary select * from cera2_temp.summary; --commit; merge into cera2.entry e using (

ON (e.entry_id = ne.entry_id) when matched then update set

when not matched then

ENTRY_ID, ENTRY_NAME, ENTRY_ACRONYM, ENTRY_TYPE_ID, SUMMARY_ID, QUALITY_ID, PROGRESS_ID, CREATION_DATE, REVIEW_DATE, FUTURE_REVIEW_DATE) values (ne.ENTRY_ID, ne.ENTRY_NAME, ne.ENTRY_ACRONYM, ne.ENTRY_TYPE_ID, ne.SUMMARY_ID, ne.QUALITY_ID, ne.PROGRESS_ID, ne.CREATION_DATE, ne.REVIEW_DATE, ne.FUTURE_REVIEW_DATE);

-- -- 5.) coverage, location -- delete coverage where entry_id = 2320485; delete location_connect where entry_id = 2320485; insert into temporal_coverage select * from cera2_temp.temporal_coverage; insert into spatial_coverage select * from cera2_temp.spatial_coverage; insert into location select * from cera2_temp.location; commit; insert into coverage select * from cera2_temp.coverage; insert into location_connect select * from cera2_temp.location_connect; /*

*/

/*

*/ merge into cera2.citation c using ( select

ON (c.citation_id = nc.citation_id) when matched then update set

when not matched then

/*

*/ --select * from entry where entry_id = 2320488; --select * from cera2_temp.entry where entry_id = 2320488; -- select * from cera2_temp.quality_atarrabi2; -- update cera2_temp.quality_atarrabi2 set entry_id = 2320486 where entry_id is null; -- irgendwo einbauen! Wo? Erledigt! (xsl) --select * from cera2_temp.quality; -- Kontrolle --select * from cera2.quality where quality_id = 2002523; -- alter quality Eintrag

insert into quality select * from cera2_temp.quality; select quality_id from cera2_temp.quality; -- new quality_id update entry set quality_id = 2002679 where entry_id = 2320485;

/* 9.) Platform / Instrument

*/ desc source_platform; select distinct source_platform_level from source_platform; select * from source_platform order by source_platform_level; desc sensor_instrument; select distinct sensor_instrument_level from sensor_instrument; desc sensor_source; select * from sensor_instrument where sensor_instrument_id = 2; select * from source_platform where source_platform_id = 116; --insert into sensor_source (entry-id, sensor_instrument_id, source_platform_id); insert into sensor_source values (2320485, 2, 116); select * from sensor_source where entry_id = 2320488;

/*

select entry_id, quality_id from entry where entry_type_id = 7 and entry_id in ( select distinct entry_id from cera2_temp.quality_atarrabi2) order by entry_id; select * from quality where quality_id in ( select quality_id from entry where entry_type_id = 7 and entry_id in (select distinct entry_id from cera2_temp.quality_atarrabi2)); /*

*/ select * from cera2_temp.quality_atarrabi2; select cera2_temp.seq_quality.nextval from dual; update entry set quality_id = 2002680 where entry_id = 2320490;

/* 10.) Files als additional infos laden: z.Z. noch Handbetrieb */

MadWiki: CERA Atarrabi2 Interface (last edited 2012-02-22 09:13:52 by HansHermannWinter)