DATA Step, Macro, Functions and more

Insert cyrillic symbols into Oracle from XML

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Insert cyrillic symbols into Oracle from XML

[ Edited ]

Hello. I need to insert some data from XML into Oracle. I extract tables from XML using xmlmap. Both XML and XMLMAP have 'UTF-8' encoding. When I select some string columns from created tables I get normal cyrillic symbols, such as 'тестовая строка'. But when I insert them into Oracle tables, these letters turn into '���������� ������'. When I try to select these Oracle tables in proc sql statement, I get '???????? ??????'. Do you have any suggestions, what's the problem.

 

proc sql;
    
    select * from XMLLIB.Table_Name; /*Checking string data, getting 'тестовая строка'*/

    
    insert into ORALIB.Table_Name
    select * from XMLLIB.Talbe_Name; /*Insert data into Oracle Talbe, returns '�������� ������'*/ 

    
    select * from ORACLE.Table_Name; /*returns '???????? ??????'*/
quit;

 

 

Once again: both &CUR_XML and &CUR_MAP have 'UTF-8' encoding. Thanks in advance.

 


Accepted Solutions
Solution
‎08-17-2017 05:52 AM
New Contributor
Posts: 2

Re: Insert cyrillic symbols into Oracle from XML

I've found the solution. The environment variable NLS_LANG was empty. I've changed it to RUSSIAN_CIS.CL8ISO8859P5 and it worked.

View solution in original post


All Replies
PROC Star
Posts: 2,218

Re: Insert cyrillic symbols into Oracle from XML

I suspect that the UTF-8 chain must not be broken for this to work.

- SAS may have to run in UTF8 mode, though since you don't use SAS storage you may be able to get away with this. Maybe.

- The Oracle database should be set to use the UTF-8 character set

- The intermediate layers (ODBC driver or SQL*Net?, SAS/Access) must also support UTF-8.

Your characters may get jumbled at any of these stages.

 

Solution
‎08-17-2017 05:52 AM
New Contributor
Posts: 2

Re: Insert cyrillic symbols into Oracle from XML

I've found the solution. The environment variable NLS_LANG was empty. I've changed it to RUSSIAN_CIS.CL8ISO8859P5 and it worked.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 138 views
  • 0 likes
  • 2 in conversation