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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -