def upload_category_codes(codes, language='Kor', level=0, cat1='', cat2='', cat3=''):
    global conn, curs
    query = '\n  INSERT INTO category_code (code, cat1, cat2, cat3, level, name_{0}) VALUES (%s, %s, %s, %s, %s, %s)\n  ON DUPLICATE KEY UPDATE name_{0}=%s\n  '.format(language.lower())
    for code in codes:
        curs.execute(query, (code['code'], cat1, cat2, cat3, level, code['name'], code['name']))
    conn.commit()
    return
def upload_category_codes(codes, language='Kor', level=0, cat1=, cat2=, cat3=):
    global conn, curs
    query = '\n  INSERT INTO category_code (code, cat1, cat2, cat3, level, name_{0}) VALUES (%s, %s, %s, %s, %s, %s)\n  ON DUPLICATE KEY UPDATE name_{0}=%s\n  '.format(language.lower())
    for code in codes:
        curs.execute(query, (code['code'], cat1, cat2, cat3, level, code['name'], code['name']))
    conn.commit()
    return