python 2.7 - Returning cursor isn't retrieving data from DB -
cursor.execute(sql_statement) conn.close() return cursor
the above closing lines of program. i've 3 html pages (users, workflows, home), returning curosor triggering data workflows , home page, not users page
where as, if return cursor.fetchall(), it's working 3 pages.
the reason why want return cursor is, client might want iterate or other processing on cursor.
i'm not sure doing different users page.
if close connection, cannot iterate cursor anymore. there no connection database.
Comments
Post a Comment