BUG: ODAC doesn't work with unicode string parameters

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Stealth
Posts: 2
Joined: Mon 04 Jul 2011 08:23

BUG: ODAC doesn't work with unicode string parameters

Post by Stealth » Thu 27 Sep 2012 09:08

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 (NLS_CHARACTERSET = AL32UTF8),
Embarcadero® Delphi® XE Version 15.0.3953.35171, ODAC 7.20.0.8, Win32 platform

Code: Select all

  var OraSession: TOraSession;
  var OraQuery: TOraQuery;
begin
  OraSession := TOraSession.Create(Application);
  with OraSession do begin
    ConnectString := 'user/password@database';
    Options.Charset := 'AL32UTF8';
    Options.UseUnicode := True;
    LoginPrompt := False;
    Connected := True;
  end;
  OraQuery := TOraQuery.Create(Application);
  with OraQuery do begin
    SQL.Text := 'select substr(:P, -1) from DUAL';
//    Params[0].AsWideString := StringOfChar('Я', 2001);
//    Params[0].AsString := StringOfChar('Я', 2001);
    Params[0].DataType := ftWideString;
    Params[0].Value := StringOfChar('Я', 2001);
    Open;
  end;
  MessageBox(0, PChar(OraQuery.Fields[0].AsString), 'Result', MB_ICONWARNING or MB_TASKMODAL);
end;
passing a string with more then 2000 "unicode" chars leads to fault with
ORA-01460 unimplemented or unreasonable conversion requested

will work with "single-byte" characters, e.g. StringOfChar('A', 4000)

the buffer can not be more than 4000 bytes? expected at least 32767!

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: BUG: ODAC doesn't work with unicode string parameters

Post by AlexP » Thu 27 Sep 2012 14:10

hello,

Thank you for the information.
We've reproduced the problem.
We will notify you as soon as we have any results.

Post Reply