Page 1 of 1

UniDAC with Oracle Unicode Problem

Posted: Thu 23 Dec 2010 23:44
by rhettp
I am trying to use UniDAC to update a Unicode Oracle database (character set: AL32UTF8

I try these 3 and nothing will update a NVARCHAR2 field correctly - it shows as ????? after the post.

UPDATE UNICODETEST SET FULL_NAME = 'ΕΖΗΘΙΚΛΜΝΞΟβγδεζηθικλμ' WHERE KEY_FIELD = 'RECORD1'

or this: UPDATE UNICODETEST SET FULL_NAME = UNISTR('ΕΖΗΘΙΚΛΜΝΞΟβγδεζηθικλμ') WHERE KEY_FIELD = 'RECORD1'

or this: UPDATE UNICODETEST SET FULL_NAME = N'ΕΖΗΘΙΚΛΜΝΞΟβγδεζηθικλμ' WHERE KEY_FIELD = 'RECORD1'

Any ideas? This problem does not occur with ODAC.

Thanks,

Rhett

Posted: Fri 24 Dec 2010 07:55
by AlexP
Hello,

To resolve the problem you should set the OraCallUni.OCIUnicode variable to true ( in this case you need to include the OraCallUni unit in the uses section), or use parameters in the query like

UPDATE UNICODETEST
SET FULL_NAME = :full_name
WHERE KEY_FIELD = 'RECORD1'

UniQuery.ParamByNAme('full_name').AsWideString:= 'ΕΖΗΘΙΚΛΜΝΞΟβγδεζηθικλμ';

a more correct variant is use is use the query with the parameters.

Posted: Fri 24 Dec 2010 16:36
by rhettp
Thanks for the help. I am actually already setting OraCalUni.OCIUnicode to True. I only had OraCall unit in my uses though. So I added OraCallUni but still had the same results.

Params have been working for me in testing, but I can't just switch this older code to Params. It's hundreds of thousands of lines of older code that uses constants.

Any other ideas?

Thanks,

Rhett

Posted: Fri 24 Dec 2010 17:05
by rhettp
Ah...! I went back and checked again and realized that I was setting OraCal.OCIUnicode - not OraCalUni.OCIUnicode to True. That did the trick! Thanks very much.

- Rhett

Posted: Mon 27 Dec 2010 07:01
by AlexP
Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.