def proc_get(proc_name, schema, param):
    """
    get proc run sql
    :param proc_name:
    :param schema:
    :param param:
    :return:
    """
    output = 'begin     ' + schema + '.' + proc_name
    params = ''
    lastindex = len(param) - 1
    if proc_name[0:3] == 'EAS':
        if param:
            params += '('
            for i in param:
                if param.index(i) != lastindex:
                    params += "'" + str(i) + "',"
                else:
                    params += "'" + str(i) + "')"
    elif proc_name == 'rtl_rp_seperate':
        if param:
            params += '('
            for i in param:
                if param.index(i) != lastindex:
                    params += "'" + str(i) + "',"
                else:
                    params += "'" + str(i) + "')"
    else:
        formats = 'yyyy-MM-dd'
        if param:
            params += '('
            for i in param:
                if param.index(i) != lastindex:
                    params += "to_date('" + str(i) + "','" + formats + "'),"
                else:
                    params += "to_date('" + str(i) + "','" + formats + "'))"
    output = output + params + ';  end;'
    return output
