Help

46 views
Skip to first unread message

Luis Rangel

unread,
Nov 20, 2023, 2:13:52 PM11/20/23
to PyMySQL Users
I have a problem getting data from my database, and I always go to the query failure case, any help for this, I am using version 0.2.9 of pymsql

    def getNumeroLote(compania,fecha ,cnxn):
        sql = "select ISNULL( MAX(SUBSTRING(lotNumLote,7,2)) , 0) as lote from Lotesxbanco where lotCodCompania = %s and SUBSTRING(lotNumLote,1,6) = %d"
        params = (compania, fecha)
        result = cnxn.cursor().execute(sql, params)
        res = result.fetchone
        return res[0]
Reply all
Reply to author
Forward
0 new messages