Delimiter $$
/**
 * Author:  armen
 * Created: 21 juin 2018
 */

--  Accounts
Drop Procedure if Exists BUSINESS_COMPUTE_PUBLICVIEWS_RECIPIENTS $$
Create Procedure BUSINESS_COMPUTE_PUBLICVIEWS_RECIPIENTS ()
Begin
    Truncate Table TMP_V_PUBLIC_RECIPIENTS_VIEW;

    Insert Into TMP_V_PUBLIC_RECIPIENTS_VIEW (
        ID_EVENTS
		, ACCOUNTS_ID_ACCOUNTS
		, EVENTS_DATE_EXPECTED_START
		, EVENTS_IS_DONE
		, EVENTS_DATE_CLOSED
		, EVENTS_IS_TRASHED
		, TASKS_ID_TASKS
		, CORRESPONDENCES_ID_CORRESPONDENCES
		, RECIPIENTS_ID_RECIPIENTS
		, CONTACTS_ID_CONTACTS
		, RECIPIENTS_HAS_READ_CONFIRM
		, RECIPIENTS_READ_CONFIRM_DATE
		, RECIPIENTS_RECPT_CONFIRM_DATE
		, RECIPIENTS_TOKEN
		, CONTACTS_GLOBAL_NAME
 
    )
    Select 
        ID_EVENTS
		, ACCOUNTS_ID_ACCOUNTS
		, EVENTS_DATE_EXPECTED_START
		, EVENTS_IS_DONE
		, EVENTS_DATE_CLOSED
		, EVENTS_IS_TRASHED
		, TASKS_ID_TASKS
		, CORRESPONDENCES_ID_CORRESPONDENCES
		, RECIPIENTS_ID_RECIPIENTS
		, CONTACTS_ID_CONTACTS
		, RECIPIENTS_HAS_READ_CONFIRM
		, RECIPIENTS_READ_CONFIRM_DATE
		, RECIPIENTS_RECPT_CONFIRM_DATE
		, RECIPIENTS_TOKEN
		, CONTACTS_GLOBAL_NAME
 
    From V_PUBLIC_RECIPIENTS_VIEW ;
End $$
Delimiter ;

