Ejemplo n.º 1
0
def getSrcTableData(srcTable, strtSK, endSK):
    global next_token
    try:
        resultSet = None
        conn = utils.connect(logger, dbEngine, dbEndpoint, dbPort, dbMisc,
                             dbUser, dbPwd)
        conn.outputtypehandler = OutputTypeHandler
        cur = conn.cursor()
        sql = sq.srcTableQyery[srcTable]
        sql = sql.replace('<MIN_SK_NM>', str(strtSK))
        sql = sql.replace('<MAX_SK_NM>', str(endSK))

        #print(sql)

        resultSet = utils.queryDB(logger, dbEngine, conn, sql, cur)
        status = True

    except Exception as e:
        next_token = logger.writeLog(
            'Error',
            'Error on getSrcTableData function for query: ',
            srcTable,
            e,
            nextToken=next_token)
        # printException(logObj)
        status = False

    return resultSet, status
Ejemplo n.º 2
0
def insProcessTrack(lastSK, ProcessTable):
    global next_token
    try:
        resultSet = None
        conn = utils.connect(logger, dbEngine, dbEndpoint, dbPort, dbMisc,
                             dbUser, dbPwd)
        cur = conn.cursor()

        sql = sq.sqlProcTrackQryIns
        sql = sql.replace('<LAST_SK>', str(lastSK))
        sql = sql.replace('<TABLE_NM>', ProcessTable)

        resultSet = utils.queryDB(logger, dbEngine, conn, sql, cur, True)
        #utils.queryDB(logger, dbEngine, conn, sql, cur, True, True, jsonList)
        status = True

    except Exception as e:
        next_token = logger.writeLog('Error',
                                     'Error on insProcessTrack function',
                                     e,
                                     nextToken=next_token)
        # printException(logObj)
        status = False

    return resultSet, status
Ejemplo n.º 3
0
def delProcessTrack():
    global next_token
    try:
        resultSet = None
        conn = utils.connect(logger, dbEngine, dbEndpoint, dbPort, dbMisc,
                             dbUser, dbPwd)
        cur = conn.cursor()

        sql = sq.sqlProcTrackQryDel
        resultSet = utils.queryDB(logger, dbEngine, conn, sql, cur, True)
        status = True

    except Exception as e:
        next_token = logger.writeLog('Error',
                                     'Error on delProcessTrack function',
                                     e,
                                     nextToken=next_token)
        # printException(logObj)
        status = False

    return resultSet, status
Ejemplo n.º 4
0
def getProcessTrack():
    global next_token
    try:
        resultSet = None
        conn = utils.connect(logger, dbEngine, dbEndpoint, dbPort, dbMisc,
                             dbUser, dbPwd)
        cur = conn.cursor()

        sql = sq.sqlProcTrackQry
        #sql = sql.replace('<JSON_PROCESS_NM>', json_process_nm)

        resultSet = utils.queryDB(logger, dbEngine, conn, sql, cur)
        status = True

    except Exception as e:
        next_token = logger.writeLog('Error',
                                     'Error on getProcessTrack function',
                                     e,
                                     nextToken=next_token)
        # printException(logObj)
        status = False

    return resultSet, status