Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
1
Indexable
Never
filtered_df = df[df['eprm_catalog'].isin(['PC_EXT']) & (df['eprm_enabled_flg'].isin(['Y']))]
    if len(filtered_df) > 0:
        for _, row in filtered_df.iterrows():
            eprm_table_name = row['eprm_table_name']
            query = f"SELECT COUNT(*) FROM {schema}.{eprm_table_name} where release_id='" + releaseId + "' AND op_id='" + opId + "' AND bu_id='" + buId + "'"
            try:
                cursor_tar.execute(query)
                result = cursor_tar.fetchone()
                query_info = f"-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ STATUS|{replicationTarget}| TABLE| {eprm_table_name}\n"
                query_info += f"-- #Query: Result:{result[0]}\n"
                query_count += 1
                query_info += query + ";\n"
                write_sql(query_info)
                print(f"Count for {eprm_table_name}: {result[0]}" + "PC_EXT")
                logging.info(f"Count for {eprm_table_name}: {result[0]}")
            except mysql.connector.Error as err:
                print(f"Error occurred while executing the query: {err}")
                logging.info(f"Error occurred while executing the query: {err}")