Delimiter $$
/**
 * Author:  armen
 * Created: 21 juin 2018
 */
--  AccountsRefs
Drop Procedure if Exists BUSINESS_COMPUTE_PUBLICVIEWS_ACCOUNTS_REFS $$
Create Procedure BUSINESS_COMPUTE_PUBLICVIEWS_ACCOUNTS_REFS ()
Begin
    Truncate Table TMP_V_PUBLIC_ACCOUNTS_REFS_VIEW;

    Insert Into TMP_V_PUBLIC_ACCOUNTS_REFS_VIEW (
        ACCOUNTS_ID_ACCOUNTS
        , ACCOUNTS_REF_CODE_1
        , ACCOUNTS_REF_CODE_2
        , ACCOUNTS_REF_CODE_3
        , ACCOUNTS_REF_CODE_4
        , ACCOUNTS_REF_CODE_5
        , ACCOUNTS_REF_CODE_6
        , ACCOUNTS_REF_CODE_7
        , ACCOUNTS_REF_CODE_8
        , ACCOUNTS_REF_CODE_9
        , ACCOUNTS_REF_CODE_10
        , ACCOUNTS_REF_CODE_11
        , ACCOUNTS_REF_CODE_12
        , ACCOUNTS_REF_CODE_13
        , ACCOUNTS_REF_CODE_14
        , ACCOUNTS_REF_CODE_15
        , ACCOUNTS_REF_CODE_16
        , ACCOUNTS_REF_CODE_17
        , ACCOUNTS_REF_CODE_18
        , ACCOUNTS_REF_CODE_19
        , ACCOUNTS_REF_CODE_20
        , ACCOUNTS_ACCRED_REF_CODE_1
        , ACCOUNTS_ACCRED_REF_CODE_2
        , ACCOUNTS_ACCRED_REF_CODE_3
        , ACCOUNTS_ACCRED_REF_CODE_4
        , ACCOUNTS_ACCRED_REF_CODE_5
    )
    Select 
        ACCOUNTS_ID_ACCOUNTS
        , ACCOUNTS_REF_CODE_1
        , ACCOUNTS_REF_CODE_2
        , ACCOUNTS_REF_CODE_3
        , ACCOUNTS_REF_CODE_4
        , ACCOUNTS_REF_CODE_5
        , ACCOUNTS_REF_CODE_6
        , ACCOUNTS_REF_CODE_7
        , ACCOUNTS_REF_CODE_8
        , ACCOUNTS_REF_CODE_9
        , ACCOUNTS_REF_CODE_10
        , ACCOUNTS_REF_CODE_11
        , ACCOUNTS_REF_CODE_12
        , ACCOUNTS_REF_CODE_13
        , ACCOUNTS_REF_CODE_14
        , ACCOUNTS_REF_CODE_15
        , ACCOUNTS_REF_CODE_16
        , ACCOUNTS_REF_CODE_17
        , ACCOUNTS_REF_CODE_18
        , ACCOUNTS_REF_CODE_19
        , ACCOUNTS_REF_CODE_20
        , ACCOUNTS_ACCRED_REF_CODE_1
        , ACCOUNTS_ACCRED_REF_CODE_2
        , ACCOUNTS_ACCRED_REF_CODE_3
        , ACCOUNTS_ACCRED_REF_CODE_4
        , ACCOUNTS_ACCRED_REF_CODE_5
    From V_PUBLIC_ACCOUNTS_REFS_VIEW ;
End $$
Delimiter ;
