Print Thread
Oracle 19, String vs WideString
#65523 03/15/24 12:19 PM
Joined: Feb 2017
Posts: 20
V
Valgar Offline OP
Member
OP Offline
Member
V
Joined: Feb 2017
Posts: 20
A client is planning to move to Oracle 19 - first testing deliver errors on strings -
Type mismatch for field 'HEITI', expecting: String actual: WideString
As far as I can tell, this occurs when components have fields added, removing the field in question and adding back solves the problem.
This may be related to change of character set...
This particular field is defined as varchar2(50), in the older version a field of type string of size 50 was created, if I delete the field, I get a new one of type widestring and size 2000
I have tried option, forcewidestringfields, but no difference.
Any way I can solve this without manually delete and get all fields?

Re: Oracle 19, String vs WideString
Valgar #65529 03/18/24 11:09 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
For Unicode UTF8 databases you will get TWideStringFields. If you previously used a single-byte character database, and if ForceWideStringFields was disabled, you will get TStringFields. To solve this you can:

  • Change all fields to TWideStringFields. Now you datasets are Unciode compatible.
  • Set Oracle.NoUnicodeSupport to True at run-time in your application before making a connection. Now the database character set will be converted to the client character set of the NLS_LANG variable, which you can force to a single-byte character set.
  • Recreate the Oracle19 database with a single-byte character set.


Marco Kalter
Allround Automations
Re: Oracle 19, String vs WideString
Valgar #65532 03/18/24 02:32 PM
Joined: Feb 2017
Posts: 20
V
Valgar Offline OP
Member
OP Offline
Member
V
Joined: Feb 2017
Posts: 20
Well,

Thank you for a quick reply, as always.

(1) I guess I should have explained that I *did* think of changing to TWideStringFields, but 430 queries in 69 forms are not something I will do in 2-3 hours, especially as there does not seem to be any logic in the change of size.
(2) I see no Oracle NoUnicodeSupport option in properties, how would I set that?
(3) Huge and multiple databases for a multi national company with number of distributed applications - I am not going to ask them to modify their policy and downgrade all other applications.

I guess I was also a bit too optimistic, as we did a similar upgrade for another client over a year ago - that client uses Devart's Oracle components, and worked without any modifications to code - so I told my client I expected this change to go smoothly...

Any other ideas? Or more information on (2)?

Re: Oracle 19, String vs WideString
Valgar #65535 03/19/24 09:42 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
About option 2: this is a global variable in the Oracle unit. You can simply use the following statement during application initialization:

Code
uses Oracle;
...
Oracle.NoUnicodeSupport := True;
...


Marco Kalter
Allround Automations
Re: Oracle 19, String vs WideString
Valgar #65536 03/19/24 11:24 AM
Joined: Feb 2017
Posts: 20
V
Valgar Offline OP
Member
OP Offline
Member
V
Joined: Feb 2017
Posts: 20
Again, thanks for a quick reply - I was assuming it was TOracleSession property, perhaps hidden.
But is only solves my problem partly.
My current applications seem to work and display characters correctly - although have not performed extensive testing.
However, if I add a component or a string field to a query, and fetch the fields in the designer, I get TWideString and the 'reverse' error.
Is it possible to have this as a property on TOraceSession, which would then also work for the designer in my database forms?

Re: Oracle 19, String vs WideString
Valgar #65540 03/20/24 09:56 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
The "NoUnicodeSupport" run-time option allows your application to run the same on single-byte character databases and UTF8 databases. You would still need to develop your application on a single-byte character database though. If you develop on a UTF8 database, you will indeed get TWideStringFields at design-time.


Marco Kalter
Allround Automations
Re: Oracle 19, String vs WideString
Valgar #65548 03/20/24 02:12 PM
Joined: Feb 2017
Posts: 20
V
Valgar Offline OP
Member
OP Offline
Member
V
Joined: Feb 2017
Posts: 20
Thank you for your reply, please reconsider having this option for design mode as well, through TOracleSession, it is not acceptable to design in one environment and run in another.
I assume I am not the only developer running into this kind of problem.
Should I be concerned that DOA will not be supported / developed in coming years?

Re: Oracle 19, String vs WideString
Valgar #65561 03/22/24 10:01 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
I have added this to the list of enhancement requests. We will continue to support & developer DOA in the future.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.033s Queries: 15 (0.007s) Memory: 2.5271 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-04-27 14:08:48 UTC
Valid HTML 5 and Valid CSS