Replies: 1 comment
-
Have you looked at https://python-oracledb.readthedocs.io/en/latest/api_manual/cursor.html#Cursor.prepare ? Check the tests for examples. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Oracle documentation makes reference to the notion that while soft parses with bind variables are better than hard parses, reusing cursors are even better than soft parses.
And here:
My interpretation is that there is a way to avoid even a soft parse through reusing a cursor.
Is there any way to "reuse a cursor" in oracledb?
To be clear, I'm not exactly clear what cursor reuse means.
The only thing I could come up with was a single-row cursor in PL/SQL which can be "reused" without calling CLOSE and OPEN again:
I was surprised to see that the above will print the value twice, even though I did not CLOSE and OPEN the cursor again.
I do not see a way to do it for multi-row cursors, which seem to require a CLOSE and OPEN. Unless this also counts as reusing a cursor.
Beta Was this translation helpful? Give feedback.
All reactions