We have a database where the character set is set to WE8MSWIN1252 which I understand is a single byte character set.
We created a schema and its tables by running a script with the following:
ALTER SYSTEM SET NLS_LENGTH_SEMANTICS=CHAR
Could we possibly lose data since we are using VARCHAR2 columns with character semantics while the underlying character set is single byte?
If you are using a single-byte character set like Windows-1252, it is irrelevant whether you are using character or byte semantics. Each character occupies exactly one byte so it doesn’t matter whether a column is declared
VARCHAR2(10 CHAR)orVARCHAR2(10 BYTE). In either case, up to 10 bytes of storage for up to 10 characters will be allocated.Since you gain no benefit from changing the
NLS_LENGTH_SEMANTICSsetting, you ought to keep the setting at the default (BYTE) since that is less likely to cause issues with other scripts that you might need to run (such as those from Oracle).