-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cx_oracle requires method to force use of NCHAR and setinputsizes for strings #4163
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
Comments
Stefan Schwarzer (@sschwarzer) wrote: About the second API: If I understand the documentation at correctly, an Oracle So a Generally, as I understand the matter so far, So according to my current understanding, there are three different concepts (where the last two are always correlated for cx_Oracle):
|
Michael Bayer (@zzzeek) wrote: Setting NCHAR across the board for all NVARCHAR2 would certainly be easiest. I've asked Anthony on the github issue. |
Michael Bayer (@zzzeek) wrote: here's a review at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/633 that will test this new setting. |
Michael Bayer (@zzzeek) wrote: also if you could try that patch locally and see if it fixes your issue. |
Stefan Schwarzer (@sschwarzer) wrote: Apart from For testing the cx_Oracle types for these columns, I created a table
and ran
Do any of these need to be considered (in addition to |
Michael Bayer (@zzzeek) wrote: these have already been included in setinputsizes, I only added NCHAR: self._include_setinputsizes = { important thing is patch solves your problem, right? it passes CI so is good on my end. |
Michael Bayer (@zzzeek) wrote: oh FIXED_NCHAR vs. FIXED_CHAR, can add that sure |
Michael Bayer (@zzzeek) wrote: this is added to the review |
Michael Bayer (@zzzeek) wrote: Use NCHAR + setinputsizes() for all NVARCHAR2 The cx_Oracle dialect now calls setinputsizes() with cx_Oracle.NCHAR Change-Id: I3989b7aaf2178c263015a7433939196b76baf1e4 → ff4898f |
Changes by Michael Bayer (@zzzeek):
|
Stefan Schwarzer (@sschwarzer) wrote: Your fix works for me. (Sorry, I wasn't able to try it earlier.) Thank you! :-) |
Michael Bayer (@zzzeek) wrote: OK you have a workaroudn for now until I release 1.2.2 ? |
Stefan Schwarzer (@sschwarzer) wrote: Yes, no problem. :) |
Michael Bayer (@zzzeek) wrote: this issue is going to have to be re-done entirely, see the discussion at https://bitbucket.org/zzzeek/sqlalchemy/issues/4242/nchar-cant-be-bound-for-every-string-value#comment-44855224 |
Michael Bayer (@zzzeek) wrote: we will bind NCHAR when the NVARCHAR2 etc. datatypes are used, but if generic Unicode is passed, it will only bind to NCHAR if use_nchar_for_unicode=True is passed (e.g. my first idea above). The change however de-emphasizes NCHAR at the DDL level as well so I'm going to keep it in 1.3. |
Migrated issue, originally created by Michael Bayer (@zzzeek)
thread at:
https://groups.google.com/d/msg/sqlalchemy/vsJBLakBP4Y/PVz5zSKCAAAJ
Anthony's info for a similar issue at:
oracle/python-cx_Oracle#119
potential APIs:
or:
A more open-ended approach, since we occasionally have issues with setinputsizes being needed or not:
the third approach could also accommodate for user-defined types. it would need some changes in DefaultDialect.set_input_sizes as well.
it's not that easy to let users just override get_dbapi_type() because that is only called upon the "impl" type that is mostly dialect-private.
the former is way easier to use but I don't know if people are going to want this applied to all datatypes across the board.
The text was updated successfully, but these errors were encountered: