Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question/FR: dynamically set update mode for cursor based access #163

Open
GitMensch opened this issue Sep 8, 2023 · 0 comments
Open

Question/FR: dynamically set update mode for cursor based access #163

GitMensch opened this issue Sep 8, 2023 · 0 comments

Comments

@GitMensch
Copy link
Contributor

Often queries come in two variants - either with or without FOR UPDATE.

While Oracle has FOR READ ONLY / FOR FETCH ONLY in principal, procob only allows FOR UPDATE. Neither the complete locking option nor the UPDATE may be a host variable.

PostgreSQL has none of the "read only" - "ignore me" options (but interestingly more locking options).

Therefore existing EXEC SQL usages that needs statements with both locking and no locking will need to have their statements duplicated and using the right one depending on some condition.
As this unnecessarily increases the LOC in the original code and much more in the generated one and also comes with the culprit that a change in the statements has to be done in both places, I'd like GixSQL to include an "extension" to specify the lock mode using a host variable.

Maybe FOR :lockmode which is then translated by GixSQL - "READ ONLY" would mean drop that clause completely, "NO KEY UPDATE" would be changed to "UPDATE" on Oracle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant