Пример #1
0
def getHanaDataList(strConnection, strSQL):
    dictPermission = getHanaPermission(strConnection)

    connect = pyhdb.connect(host=dictPermission["strHost"],
                            port=30015,
                            user=dictPermission["strUser"],
                            password=dictPermission["strPassword"])
    cursor = connect.cursor()
    cursor.execute(strSQL)
    listData = Common.getFetchAllList(cursor)
    cursor.close()
    connect.close()

    return listData
Пример #2
0
def getMariaDataList(strConnection, strDB, strSQL):
    dictPermission = getMariaPermission(strConnection)

    connect = pymysql.connect(host=dictPermission["strHost"],
                              user=dictPermission["strUser"],
                              passwd=dictPermission["strPasswd"],
                              db=strDB,
                              charset="utf8")
    cursor = connect.cursor()
    cursor.execute(strSQL)
    listData = Common.getFetchAllList(cursor)
    cursor.close()
    connect.close()

    return listData
Пример #3
0
def executeMariaProcedure(strConnection, strDB, strProcName, arrayArguments):
    dictPermission = getMariaPermission(strConnection)

    connect = pymysql.connect(host=dictPermission["strHost"],
                              user=dictPermission["strUser"],
                              passwd=dictPermission["strPasswd"],
                              db=strDB,
                              charset="utf8")
    cursor = connect.cursor()
    cursor.callproc(strProcName, arrayArguments)
    cursor.execute("SELECT @_" + strProcName + "_" +
                   str(len(arrayArguments) - 1) + " AS SP_RESULT;")
    listData = Common.getFetchAllList(cursor)
    cursor.close()
    connect.close()

    return listData[0]["SP_RESULT"]