Skip to main content

Good afternoon,
I have some problem how to insert special characters via procedure into the database.

I have a simple function that takes me through a purchase order, goes through the item numbers and adjusts the description accordingly. In the Czech description there is a character "č", which then gets me wrong in the database and I don't know where I am making a mistake. 

and in IFS and database i see this 

Thanks you guys 

Hello, 

This could be due to the character set of your database not supporting this character.
 
you can check that using below SQL staement 
SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET';
 AL32UTF81 character set supports “č” and many more special characters.

Solution:

1: Change your character set.
2: Use Unicode characters like (UNISTR('\010D')) for “č”, but since you might be having many special characters, I would recommend the 1st solution.

 

Hope that helps 


Hello,
you can easily convert it using ASCIISTR function. Or I use powershell script to convert whole script (attached).

SELECT ASCIISTR('ĚŠČŘŽÝÁÍÉ=ěščřžýáíé') from dual; -- E\0160CR\017D\00DD\00C1\00CD\00C9=e\0161cr\017E\00FD\00E1\00ED\00E9
SELECT TO_CHAR(UNISTR('E\0160CR\017D\00DD\00C1\00CD\00C9=e\0161cr\017E\00FD\00E1\00ED\00E9')) FROM dual; -- EŠCRŽÝÁÍÉ=ešcržýáíé

unistr_text_ VARCHAR2(2000) := TO_CHAR(UNISTR('E\0160CR\017D\00DD\00C1\00CD\00C9=e\0161cr\017E\00FD\00E1\00ED\00E9')); -- EŠCRŽÝÁÍÉ=ešcržýáíé


Changing character set is not always possible - IFS installer just use some and it is not possible to change it.


Reply