Problems Using Specific Characters in DBEdit

thagino

Member
Delphi 10.3 Rio, DOA 4.1.3, Oracle Instant Client 18.5

I use an OracleDataSet via a ClientDataSet.
If the data type of the table is NVARCHAR2, when DBEdit attempts to update a string whose first character is "一"(U+4E00) with ApplyUpdate, the SQL generated by the OracleDataSet becomes null and is updated with null.
This does not occur if the data type of the table is VARCHAR2.

dfm(excerpt)
object OracleDataSet1: TOracleDataSet
SQL.Strings = (
'SELECT TMP_TABLE.STR_1 FROM TMP_TABLE WHERE SEQ_ID = :SEQ_ID') //SEQ_ID is KEY
end

object DataSetProvider1: TDataSetProvider
DataSet = OracleDataSet1
ResolveToDataSet = True
end

object ClientDataSet1: TClientDataSet
Aggregates =
Params = <
item
DataType = ftInteger
Name = 'SEQ_ID' //KEY
ParamType = ptInput
end>
ProviderName = 'DataSetProvider1'
end

object DataSource1: TDataSource
DataSet = ClientDataSet1
end

object DBEdit1: TDBEdit
DataField = 'STR1'
DataSource = DataSource1
end

source(excerpt)
OracleSession1.LogOn;
ClientDataSet1.Params.ParamValues['SEQ_ID'] := 1;
ClientDataSet1.Active := True;

//At this point, DBEdit1 is displaying values from the database.
//Edit DBEdit1 to "一丁目"(U+4E00,U+4E01,U+76EE).

ClientDataSet1.ApplyUpdates(-1);
ClientDataSet1.RefreshRecord;

// DBEdit1 is empty.

OracleMonitor Output
Form1.OracleDataSet1.DMLQuery
update TMP_TABLE
set STR1 = null // null changed
where rowid = :doa__rowid
returning rowid into :doa__rowid

Is there any way to solve the problem?
 
The current settings are as follows:

Client Character Set
NLS_LANG=JAPANESE_JAPAN.JA16SJIS

Database Character Set
NLS_CHARACTERSET=AL32UTF8
NLS_NCHAR_CHARACTERSET=AL16UTF16

I changed the client-side character set to "Japanese_Japan.AL32UTF8", but the symptoms did not change.
 
Last edited:
Characters other than "一"(U+4E00) cause the same phenomenon in "堀"(U+5800), "紀"(U+2F96A) and "最"(U+6700).
 

Similar threads

Back
Top