Subversion Repositories SmartDukaan

Rev

Rev 14094 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14094 Rev 14095
Line 12... Line 12...
12
    
12
    
13
    for rec in result:
13
    for rec in result:
14
        updateSql = "update purchaseorder set status = 3 where supplierId = %d and DATE(createdAt) < DATE(SUBDATE(NOW(), %d))"%(rec[0],rec[1])
14
        updateSql = "update purchaseorder set status = 3 where supplierId = %d and DATE(createdAt) < DATE(SUBDATE(NOW(), %d))"%(rec[0],rec[1])
15
        print updateSql
15
        print updateSql
16
        try:
16
        try:
17
            # Execute the SQL command
17
            # Execute the update SQL command
18
            cursor.execute(updateSql)
18
            cursor.execute(updateSql)
19
            # Commit your changes in the database
19
            # Commit your changes in the database
20
            db.commit()
20
            db.commit()
21
        except:
21
        except:
22
            # Rollback in case there is any error
22
            # Rollback in case there is any error