开发者

Store cyrillic in Oracle

开发者 https://www.devze.com 2023-02-09 12:28 出处:网络
I have Oracle database with following settings NLS_CHARACTERSETEE8MSWIN1250 NLS_NCHAR_CHARACTERSETAL16UTF16

I have Oracle database with following settings

NLS_CHARACTERSET                 EE8MSWIN1250
NLS_NCHAR_CHARACTERSET           AL16UTF16
NL开发者_如何学CS_LANGUAGE                     AMERICAN

I've created test table with one column of type NVARCHAR2, where I'm going to store cyrillic.

I use SQL Developer to connect DB.

The problem is when I put a cyrillic chain into DB using SQL Developer cell, the data is stored correctly. But when I use INSERT query with the same data using N'' or not the data is stored as question marks.

Interesting thing is that query generated by SQL Developer, and written by me is identical.

I solved this problem by changing NLS_CHARACTERSET to UTF8, but on production server I can't do such a thing.

IMO it must be some way to store cyrillic into that DB in proper way using query if SQL Developer can do that.

Regards


Depending on the ODBC/JDBC in use, localization settings on your computer may override any config values in the database. Try using ALTER SESSION and set the proper NLS parameters before executing your query, and see if that helps. SQL developer might do this behind the scenes when you edit the data cell.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号