Untitled

mail@pastecode.io avatarunknown
plain_text
2 months ago
795 B
1
Indexable
Never
    try:
        # Connect to PPM_PC database
        conn_ppm, cursor_ppm, schema_ppm = connect_to_database(json_data, 'PPM_PC')

        # Fetch data from the etl_ppm_replication_master table
        primary_query = f"SELECT * FROM {schema_ppm}.etl_ppm_replication_master"

        df = pd_read_sql(primary_query, con=conn_ppm)
        columns = df.columns.tolist()
        rows = df.values.tolist()

        # replicationTarget
        connection_tar, cursor_tar, schema_tar = connect_to_database(json_data, replicationTarget)
        # cursor_tar = connection_tar.cursor()
    except Exception as e:
        print("An Error occured:", str(e))


i have abive code can you modify one thing like if there are no records present primary_query in the execpetion print no records