← Back to team overview

maria-discuss team mailing list archive

debug.csr error?

 

Using create table.
error shown
>  python createRItbl.py
Debug.csr
Traceback (most recent call last):
  File "/home/dpawson/Dropbox/2022/sibc/software/mariadb/createRItbl.py",
line 82, in <module>
    showcsr(csr)
  File "/home/dpawson/Dropbox/2022/sibc/software/mariadb/createRItbl.py",
line 40, in showcsr
    for item in csr:
  File "/home/dpawson/.local/lib/python3.10/site-packages/mysql/connector/cursor_cext.py",
line 718, in fetchone
    return self._fetch_row()
  File "/home/dpawson/.local/lib/python3.10/site-packages/mysql/connector/cursor_cext.py",
line 689, in _fetch_row
    row = self._rows[self._next_row]
TypeError: 'NoneType' object is not subscriptable


Called from Python.

Table= f"CREATE TABLE IF NOT EXISTS rinkincome (\
  matchdate DATE ,\
  session ENUM('rollup','league','club match') ,\
  code ENUM {costcodes} ,\
  cashOrCard ENUM('card','cash'),\
  amount DECIMAL(5,2)  );"

where costcodes=('a','b') form.

# print Table out to check syntax
#print(Table)
#sys.exit(0)


csr.execute(Table)
showcsr(csr)

Nothing shown to indicate which list / structure I'm trying
to iterate over?

Any suggestions to chase down the fault please.

Pretty new to mariadb.

regards


-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.