Page 1 of 1

query with 'őű' in where

Posted: Wed 28 Nov 2012 12:08
by ketas
Hello,
  • i have table test:

    CREATE TABLE TEST( PRODUCT_NAME_ID NUMBER( 15 ) NOT NULL, NAME VARCHAR2( 50 char ) NOT NULL )
    data:
    insert into test(product_name_id,name) values (1,chr(245)||chr(251));
    (chr 245 in eemswin1250 = 'ő' ,251 = 'ű' ),

    database has nls_characterset = EE8MSWIN1250,
    used devart components - torasession, toraquery

    oracle instantclient_11_2 is used , nls_lang = HUNGARIAN_HUNGARY.EE8MSWIN1250
    oraquery.sql.text = select product_name_id,name, dump(name) from test where name = 'őű'

    this query return (in ide or little app) 0 records, not depends of option orassession.useunicode is true or false
    query select product_name_id,name, dump(name) from test where name = :name',
    where parameter name is widestring, in , value = 'őű' returns correct 1 record.

    Is this bug in parser or made i some mistake?

    Thanks. Vojslav

    P.S. odac version 8.5.9 or 8.5.10 tested
    delphi xe2 update 4, hotfix 1
    window 7 professional

Re: query with 'őű' in where

Posted: Wed 28 Nov 2012 12:35
by AlexP
Hello,

To make such query work, you should set the UseUnicode option and OCIUnicode (declared in OraCall) to True

Code: Select all

uses ..., OraCall;
....
  OCIUnicode := true;
  OraSession1.Options.UseUnicode := True;
  OraSession1.Connect;
  OraQuery1.SQL.Text := 'select product_name_id,name, dump(name) from test where name = ''őű''';
  OraQuery1.Open;

Re: query with 'őű' in where

Posted: Wed 28 Nov 2012 12:39
by ketas
Hello,

many tanks, it works :-). vojslav

Re: query with 'őű' in where

Posted: Wed 28 Nov 2012 12:51
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.