delphi6 dropping character from Oracle nVarChar2

avertsys

Member
Hi All,

Delphi 6; DOA 4.1.1.0

Doing some searching i found this
https://forums.allroundautomations.com/ubb/ubbthreads.php?ubb=showflat&Number=47955

Here's the issue...

if our oracle DB char field is VarChar2(20) everything is fine

if it's NVarChar2(20) then?

whenever we open a query the last (20th) character of the field is NOT returned to Delphi's DOAQuery.fieldByname().asString

ie. if the field has 20 full characters? Delphi is only getting 19 of them.

help !!

thanks
kelly

 
The fields are dynamically created by the .active = true of the TOracleDataSet

I would assume StringField? maybe WideStringField? I'm not sure.

but it's string data and it's NOT a BLOB / Memo field.
 
Oh... and in the Oracle table itself? The field is a NVarChar2().

If we change it to VarChar2() DOA returns the last character of the field.

If it's NVarChar2() DOA does NOT return the last character of the field.

ie. if it's NVarChar2(20) then only 19 characters are in the DOA query string field. If it's VarChar2(20) then all 20 characters are in the DOA query field.

in Oracle table editors (ie. external to DOA tools)? both show all 20 characters.

thanks!!
 
Hi,

The query has no persistent fields, so, they are all created when the .Active is set to true.

if i do query.fields[16].datatype i get ftWord

[16] is a nVarChar2(20)

it's .size is 40

i'm unclear on how to get the dynamic creation of fields to be tWideString or what the impact of that will be given all my other controls / report engine (Rave / Nevrona) are expecting tStringField IF the answer is "well, you need TWideStringField"...

thanks!!
 
in the tOracleSession properties

.BytesPerCharacter = bcAutoDetect

.Preferences.ForceWideStringFields = true

neither of those affected anything.

thoughts?

thanks
 
Back
Top