파이썬과 sqlite에 관계없이이 오류가 발생합니다.SQLite에서 (다른 테이블에서) 페치하는 동안 행 삽입
File "addbooks.py", line 77, in saveBook
conn.commit()
sqlite3.OperationalError: cannot commit transaction - SQL statements in progress
코드는 다음과 같습니다
conn = sqlite3.connect(fname)
cread = conn.cursor()
cread.execute('''select book_text from table''')
while True:
row = cread.fetchone()
if row is None:
break
....
for entry in getEntries(doc):
saveBook(entry, conn)
가 fetchall 할 수 없습니다
() 테이블 및 열 크기가 큰, 그리고 메모리가 부족하기 때문이다.더티 트릭을 사용하지 않고 수행 할 수있는 작업은 다음과 같습니다 (메모리에 ROWID를 가져 오는 것, 적합 할 것 같은 행을 하나씩 선택하는 것)?
그래, 조금 까다 롭다. :-) – Samuel