I would like to make daily movement report which has over 1500 items
First I refer to which date have Incoming and Outgoing transaction
Second I refer which parts and qty I have transaction
I have made 2 programs, one for day by day I inquire do I have Incoming
transaction today, do I have Outgoing transaction today, which Items are
involved and how many qty
The other one is in one shot all daily transaction for incoming,outgoing, Item
and qty generated by one Stored procedure.
First one, say storing days into days variable to loop, each day I inquire
Incoming Item and Qty, Outgoing Item and Qty
If I do that, say 20 days/month, 100 incoming, 1200 outgoing, require many
inquiry to DB
it show very unstable "(item, qty)" supposed to be returned but sometimes
(None,qty)=(there is qty say 8 but no Item) only return without errors, not
always same place(incoming,outgoing)
Second one, number of return records are a lot so that not able to execute.
Before I inquire to DB, I must connect, after inquire do I need to disconnect
?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Based on your other thread, you are using pymysql and not MySQLdb so your
question can't be answered here with certainty.But no, connect/disconnect is
not necessary. However, since you are probably depending on transactional
properties, you need to call cursor.commit() or cursor.rollback()
appropriately. Executing any SQL query (including SELECT) implicitly starts a
new transaction. I would say that before you make your query, you should try a
cursor.rollback(), to make sure there is no pending transaction.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to make daily movement report which has over 1500 items
First I refer to which date have Incoming and Outgoing transaction
Second I refer which parts and qty I have transaction
I have made 2 programs, one for day by day I inquire do I have Incoming
transaction today, do I have Outgoing transaction today, which Items are
involved and how many qty
The other one is in one shot all daily transaction for incoming,outgoing, Item
and qty generated by one Stored procedure.
First one, say storing days into days variable to loop, each day I inquire
Incoming Item and Qty, Outgoing Item and Qty
If I do that, say 20 days/month, 100 incoming, 1200 outgoing, require many
inquiry to DB
it show very unstable "(item, qty)" supposed to be returned but sometimes
(None,qty)=(there is qty say 8 but no Item) only return without errors, not
always same place(incoming,outgoing)
Second one, number of return records are a lot so that not able to execute.
Before I inquire to DB, I must connect, after inquire do I need to disconnect
?
Based on your other thread, you are using pymysql and not MySQLdb so your
question can't be answered here with certainty.But no, connect/disconnect is
not necessary. However, since you are probably depending on transactional
properties, you need to call cursor.commit() or cursor.rollback()
appropriately. Executing any SQL query (including SELECT) implicitly starts a
new transaction. I would say that before you make your query, you should try a
cursor.rollback(), to make sure there is no pending transaction.