Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Issues using ADO to read Unicode characters from Oracle DB

28 views
Skip to first unread message

Ram Mulay

unread,
Feb 16, 2006, 5:03:58 PM2/16/06
to
I have a column in an Oracle 9i table that is nvarchar2(50). I 'think' I
have successfully written unicode characters (greek) into this column using
ADO parameterized types. I say I 'think' because when I go to read it, it
comes back as inverted '?' characters. But when I say "select veh_key from
vehicles where veh_desc = 'the right Greek chracters'", I get the right
veh_key.

The code I am using looks like this...

To update:
ADOQuery1.Parameters.CreateParameter('veh_desc', ftWideString, pdInput, 0,
null);
ADOQuery1.Parameters.ParamByName('veh_desc').Value := wDesc;
ADOQuery1.Parameters.CreateParameter('veh_key', ftInteger, pdInput, 0,
null);
ADOQuery1.Parameters.ParamByName('veh_key').Value := wKey;
ADOQuery1.SQL.Add(wSQLStr);
ADOQuery1.ExecSQL;

To read:
ADOQuery1.Parameters.CreateParameter('veh_key', ftInteger, pdInput, 0,
null);
ADOQuery1.Parameters.ParamByName('veh_key').Value := StrToInt(Edit2.Text);
ADOQuery1.SQL.Add(wSQLStr);
ADOQuery1.Open;
if not ADOQuery1.Eof then
wSpecStr := ADOQuery1.FieldByName('veh_desc').AsWideString;


Some more points:
1. All works fine on SQL Server.
2. I have set the NLS_LANG environment variable on my client to be
'AMERICAN_AMERICA.AL16UTF16'
3. On the DB server, the NLS_CHARACTERSET parameter is WE8MSWIN1252 and
NLS_NCHAR_CHARACTERSET is AL16UTF16.

Any ideas?


Bernhard Geyer

unread,
Feb 17, 2006, 3:15:56 AM2/17/06
to

Which OLE DB-Provider do you use. The MS OLE DB-Provider for Oracle.
I wound't recoment this because this is only a "Test-Provider" to show
that you can use ADO.

I would recoment you to use the native acccess components form CoreLab
to work with Oracle. They support Unicode for Oracle.

Ram Mulay schrieb:

Ram Mulay

unread,
Feb 17, 2006, 2:17:23 PM2/17/06
to
We use the Oracle supplied OLEDB provider.

Looks like Corelab's dbExpress drivers are the same as the ones shipped by
Borland Delphi.
Do you know if the sql statements have to change when this driver is used
for Oracle? What I mean is do we have to use the N'' syntax for
inserts/updates of parameterized variables? For SQL Server, it was not
required...fyi.

Thanks.

"Bernhard Geyer" <Bernhar...@nospam.de> wrote in message
news:43f5...@newsgroups.borland.com...

Bernhard Geyer

unread,
Feb 18, 2006, 12:54:31 PM2/18/06
to
Ram Mulay schrieb:

> We use the Oracle supplied OLEDB provider.
>
> Looks like Corelab's dbExpress drivers are the same as the ones shipped by
> Borland Delphi.
> Do you know if the sql statements have to change when this driver is used
> for Oracle? What I mean is do we have to use the N'' syntax for
> inserts/updates of parameterized variables? For SQL Server, it was not
> required...fyi.
>

I don't know. I'm using some other native Component and do the necessare
UTF8 Coding/Decoding in our own DB-Access-Layer.

0 new messages