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

FR: allow mapping of "NoRecCode" #95

Closed
GitMensch opened this issue Jul 26, 2022 · 3 comments
Closed

FR: allow mapping of "NoRecCode" #95

GitMensch opened this issue Jul 26, 2022 · 3 comments

Comments

@GitMensch
Copy link
Contributor

citpgsql docs claim that

Oracle SQLCODE for a NOT FOUND condition is 1403

and provides a preparser option to adjust that number.

gixsql has that currently hard-coded to 100-

if (err == DBERR_NO_DATA)
st->sqlcode = 100;

It would be nice to be able to configure that to support migrations (code that checks for 1403 - or any other number).
I'm not sure that a preparser option is the best way (would be possible but then would need to be passed as option, likely to GIXSQLStartSQL). Providing a runtime variable that is read in only during startup and parsed to a numeric value once - then be used looks like a "cover most cases" and quite easy, so maybe go with that (at least until a different request gets up)?

@GitMensch
Copy link
Contributor Author

GitMensch commented Aug 17, 2022

ping to be added to a milestone (not necessarily next release); something like GIXSQL_NOREC_CODE looks easy, and would really help with conversions from citpgsql and maybe procob, but I'm unsure if that is a a good or bad design (in theory it would be more reasonable to specify that at compile time, but that hard-coding is down in the inner circles of the runtime).

@mridoni
Copy link
Owner

mridoni commented Aug 22, 2022

This actually requires support both in the runtime (for obvious reasons) and in the preprocessor (to generate the WHENEVER NOT FOUND clauses correctly).

I implemented this and I am testing it, if all goes well it should be in v1.0.18

mridoni added a commit that referenced this issue Aug 23, 2022
- Added new Oracle driver, based on ODPI
- Added new SQLite driver
- All the drivers have been updated and now implement the complete set of supported features
- Solution for "PG: issue with prepared statements" (#99)
- Solution for "PCursors cannot be re-opened after close" (#98)
- Solution for "libgixpp: setStatus is called for errors without DBI parm passed - sets SQLERRM" (#94)
- Solution for "error handling (especially for 07001)" (#92)
- Solution for "show-stopper bug in pgsql_prepare" (#91)
- Solution for "PREPARE does not work with VARLENGTH groups (ocesql compat)" (#79)
- Partial solution for "PREPARE does not work with VARLENGTH groups (ocesql compat)" (#68)
- Solution for "The PostgreSQL driver needs START TRANSACTION before using cursors" (#14)
- Solution for "FR: support EXEC SQL VAR" (#21)
- Fixed a bug in "problems with "codegen / logic issue for "GIXSQLCursorDeclareParams" (#88)
- Solution for "FR: allow mapping of "NoRecCode"' (#95) - added --no-rec-code parameter to gixpp
- Tokens in the parser have been labeled to improve diagnostics (pulled PR #96 by @GitMensch)
- Fixed COMP-3 handling in drivers other than PostgreSQL
- Rewrote the test suite (still MSTest-based) to dynamically generate a matrix of test to be run on the various platforms/database drivers
- Added options for parameter generation in gixpp (-a was removed)
- Added new GIXSQL_FIXUP_PARAMS option for runtime, to automatically convert parameter format in prepared statments
- "Native" cursors are now the default for the PostgreSQL driver
- "Smart" cursor initialization is now the default for all cursors, including those declared in WORKING-STORAGE (-L was removed from gixpp), should fix #101
- Removed dynamic cursor emulation from the ODBC driver when using PostgreSQL
@GitMensch
Copy link
Contributor Author

Tested the runtime part - works like a charm.

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

2 participants