--------------------------------------------------------
--  DDL for Trigger TRG_DEP_REQ_HGROUP
--------------------------------------------------------

  CREATE OR REPLACE EDITIONABLE TRIGGER "ENVX_OPER"."TRG_DEP_REQ_HGROUP" AFTER
    INSERT ON deployment_request
    FOR EACH ROW
BEGIN
    INSERT INTO deployment_req_hgroup VALUES (
        'R' || :new.id_request,
        NULL,
        'R',
        :new.id_request,
        :new.id_request,
        :new.id_request,
        1,
        NULL,
        pkg_deploy_coordinator.request_hgroup_name(
            pi_id_request          => :new.id_request,
            pi_id_enviroment_type  => :new.id_enviroment_type,
            pi_creation_date       => :new.creation_date
        ),
        NULL,
        NULL,
        NULL,
        NULL
    );

END;
/
ALTER TRIGGER "ENVX_OPER"."TRG_DEP_REQ_HGROUP" ENABLE;
