drop table if exists lst_temp_prj; create table lst_temp_prj (prj_id bigint); insert into lst_temp_prj select project_id from PROJECT where project_id in (xxxx); drop table if exists id_temp; create table id_temp (id bigint); create index idx on id_temp(id); drop table if exists id_temp_str; create table id_temp_str (id varchar(50)); create index idx_str on id_temp_str(id); -- Action Word delete from AWLN_RELATIONSHIP z using AWLN_RELATIONSHIP b join ACTION_WORD_LIBRARY_NODE c on b.ancestor_id=c.awln_id join PROJECT d on c.awl_id=d.awl_id join lst_temp_prj e on d.project_id=e.prj_id where b.ancestor_id=z.ancestor_id; delete from AWLN_RELATIONSHIP z using AWLN_RELATIONSHIP b join ACTION_WORD_LIBRARY_NODE c on b.descendant_id=c.awln_id join PROJECT d on c.awl_id=d.awl_id join lst_temp_prj e on d.project_id=e.prj_id where b.descendant_id=z.descendant_id; delete from AWLN_RELATIONSHIP_CLOSURE z using AWLN_RELATIONSHIP_CLOSURE b join ACTION_WORD_LIBRARY_NODE c on b.ancestor_id=c.awln_id join PROJECT d on c.awl_id=d.awl_id join lst_temp_prj e on d.project_id=e.prj_id where b.ancestor_id=z.ancestor_id; delete from AWLN_RELATIONSHIP_CLOSURE z using AWLN_RELATIONSHIP_CLOSURE b join ACTION_WORD_LIBRARY_NODE c on b.descendant_id=c.awln_id join PROJECT d on c.awl_id=d.awl_id join lst_temp_prj e on d.project_id=e.prj_id where b.descendant_id=z.descendant_id; delete from ACTION_WORD_LIBRARY_NODE z using ACTION_WORD_LIBRARY_NODE a join PROJECT b on a.awl_id=b.awl_id join lst_temp_prj c on b.project_id=c.prj_id where a.awln_id=z.awln_id and z.entity_type <> 'LIBRARY'; -- Chemin AWPV - AWFragment - AW delete from ACTION_WORD_PARAMETER_VALUE z using ACTION_WORD_PARAMETER_VALUE a join ACTION_WORD_FRAGMENT b on a.action_word_fragment_id=b.action_word_fragment_id join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where a.action_word_parameter_value_id=z.action_word_parameter_value_id; delete from ACTION_WORD_PARAMETER z using ACTION_WORD_PARAMETER a join ACTION_WORD_FRAGMENT b on a.action_word_fragment_id=b.action_word_fragment_id join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where a.action_word_fragment_id=z.action_word_fragment_id; delete from ACTION_WORD_TEXT z using ACTION_WORD_TEXT a join ACTION_WORD_FRAGMENT b on a.action_word_fragment_id=b.action_word_fragment_id join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where a.action_word_fragment_id=z.action_word_fragment_id; delete from ACTION_WORD_FRAGMENT z using ACTION_WORD_FRAGMENT b join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where b.action_word_fragment_id=z.action_word_fragment_id; -- Chemin AWPV - KWTest step - AW delete from ACTION_WORD_PARAMETER_VALUE z using ACTION_WORD_PARAMETER_VALUE a join KEYWORD_TEST_STEP b on a.keyword_test_step_id=b.test_step_id join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where a.action_word_parameter_value_id=z.action_word_parameter_value_id; delete from KEYWORD_TEST_STEP z using KEYWORD_TEST_STEP b join ACTION_WORD c on b.action_word_id=c.action_word_id join lst_temp_prj d on c.project_id=d.prj_id where b.test_step_id=z.test_step_id; -- Chemin AWPV - KWTest step - Test step delete from ACTION_WORD_PARAMETER_VALUE z using ACTION_WORD_PARAMETER_VALUE a join TEST_CASE_STEPS b on a.keyword_test_step_id=b.step_id join TEST_CASE_LIBRARY_NODE c on b.test_case_id=c.tcln_id join lst_temp_prj d on c.project_id=d.prj_id where a.action_word_parameter_value_id=z.action_word_parameter_value_id; delete from KEYWORD_TEST_STEP z using KEYWORD_TEST_STEP a join TEST_CASE_STEPS b on a.test_step_id=b.step_id join TEST_CASE_LIBRARY_NODE c on b.test_case_id=c.tcln_id join lst_temp_prj d on c.project_id=d.prj_id where a.test_step_id=z.test_step_id; delete from ACTION_WORD z using ACTION_WORD a join lst_temp_prj b on a.project_id=b.prj_id where a.action_word_id=z.action_word_id;