예제 #1
0
    def __init__(self, root, RunByUsername, log):
        #root = "E:/CUA OpenBank API/OpenBanking/ETL"
        log.logComment("Initialized MasterLendingRate (022)")

        conn = Connector(root, RunByUsername, log)

        self.FailInd = conn.openConnector()

        log.logComment("MasterLendingRate (022) -> Connection Status: " +
                       str(self.FailInd))

        transform = Transform(conn, root, log)

        transform.fileList = ['CCC_Rate.csv']

        masterQuery = (
            "SELECT ID, LENDINGRATETYPE FROM MASTER_LENDINGRATETYPE").lower()

        insertStatement = ("INSERT INTO MASTER_LENDINGRATETYPE "
                           "(ID, LENDINGRATETYPE) VALUES (%s, %s)").lower()

        transform.joinerColumn = 'Rate Type (Mandatory)'

        if self.FailInd == 0:
            log.logComment("MasterLendingRate (022) -> Inserting data")
            transform.masterInsert(masterQuery, insertStatement)

            log.logComment("MasterLendingRate (022) -> Connection Closed")
            conn.closeConnector()
        else:
            log.logComment(
                "MasterLendingRate (022) -> Inserting data -> Failed")
예제 #2
0
    def __init__(self, root, RunByUsername, log):
        #root = "E:/CUA OpenBank API/OpenBanking/ETL"
        log.logComment("Initialized ProductCategory (026)")

        conn = Connector(root, RunByUsername, log)

        self.FailInd = conn.openConnector()

        log.logComment("ProductCategory (026) -> Connection Status: " +
                       str(self.FailInd))

        transform = Transform(conn, root, log)

        transform.fileList = [
            'CCC_Products.csv', 'TeD_Products.csv', 'TnS_Products.csv'
        ]

        masterQuery = "SELECT ID, PRODUCTCATEGORY FROM PRODUCT_CATEGORY".lower(
        )

        insertStatement = ("INSERT INTO PRODUCT_CATEGORY "
                           "(ID, PRODUCTCATEGORY) VALUES (%s, %s)").lower()

        transform.joinerColumn = 'productCategory (Mandatory)'

        if self.FailInd == 0:
            log.logComment("ProductCategory (026) -> Inserting data")
            transform.masterInsert(masterQuery, insertStatement)

            log.logComment("ProductCategory (026) -> Connection Closed")
            conn.closeConnector()
        else:
            log.logComment("ProductCategory (026) -> Inserting data -> Failed")
예제 #3
0
    def __init__(self, root, RunByUsername, log):
        #root = "E:/CUA OpenBank API/OpenBanking/ETL"
        log.logComment("Initialized MasterConstraint (015)")

        conn = Connector(root, RunByUsername, log)

        self.FailInd = conn.openConnector()

        log.logComment("MasterConstraint (015) -> Connection Status: " +
                       str(self.FailInd))

        transform = Transform(conn, root, log)

        transform.fileList = [
            'CCC_Constraints.csv', 'TeD_Constraints.csv', 'TnS_Constraints.csv'
        ]

        masterQuery = (
            "SELECT ID, CONSTRAINTTYPE FROM MASTER_CONSTRAINTS").lower()

        insertStatement = ("INSERT INTO MASTER_CONSTRAINTS "
                           "(ID, CONSTRAINTTYPE) VALUES (%s, %s)").lower()

        transform.joinerColumn = 'Constraint Type'

        if self.FailInd == 0:
            log.logComment("MasterConstraint (015) -> Inserting data")
            transform.masterInsert(masterQuery, insertStatement)

            log.logComment("MasterConstraint (015) -> Connection Closed")
            conn.closeConnector()
        else:
            log.logComment(
                "MasterConstraint (015) -> Inserting data -> Failed")
예제 #4
0
    def __init__(self, root, RunByUsername, log):
        #root = "E:/CUA OpenBank API/OpenBanking/ETL"
        log.logComment("Initialized  MasterEligibility (019)")

        conn = Connector(root, RunByUsername, log)

        self.FailInd = conn.openConnector()

        log.logComment(" MasterEligibility (019) -> Connection Status: " +
                       str(self.FailInd))

        transform = Transform(conn, root, log)

        transform.fileList = [
            'TnS_Eligibility.csv', 'TeD_Eligibility.csv', 'CCC_Eligibility.csv'
        ]

        masterQuery = "select id, eligibilityType from master_eligibility".lower(
        )

        insertStatement = ("INSERT INTO master_eligibility "
                           "(ID, eligibilityType) VALUES (%s, %s)").lower()

        transform.joinerColumn = 'Eligibility Type'

        if self.FailInd == 0:
            log.logComment(" MasterEligibility (019) -> Inserting data")
            transform.masterInsert(masterQuery, insertStatement)

            log.logComment(" MasterEligibility (019) -> Connection Closed")
            conn.closeConnector()
        else:
            log.logComment(
                " MasterEligibility (019) -> Inserting data -> Failed")