BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AlexTime
Calcite | Level 5

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
AlexTime
Calcite | Level 5

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

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

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.

 

AlexTime
Calcite | Level 5

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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