SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_find_cli_by_risk_situation_id]
	@id int
AS

	SELECT  act_actor_id,
			act_type_code,
			act_internal_reference,
			act_external_reference,
			adr_name,
			adr_complete_name,
			adr_address1,
			adr_address2,
			adr_address3
	FROM    vw_act_actors_adresses
			INNER JOIN act_clients on cli_actor_id = act_actor_id
			INNER JOIN pol_policies on cli_actor_id = pol_client_id 
			INNER JOIN ris_risks on ris_policy_id = pol_policy_id
			INNER JOIN ris_risks_situations on riss_risk_id = ris_risk_id
	WHERE	riss_risk_situation_id = @id

GO
