1

I need to insert currency Mongolian tögrög and symbol to Oracle Database. The insert query as :

INSERT INTO CURRENCY (CUR_ISO_ID, CUR_ISO_CODE, CUR_DESC, CUR_DECIMAL_PLACE, CUR_SYMBOL) 
              VALUES (496,'MNT','Mongolian tögrög',2,'₮');

results as:

 CUR_ISO_ID | CUR | CUR_DESC         | CUR_DECIMAL_PLACE | CUR_SYMBOL |
-----------------------------------------------------------------------
 496        | MNT | Mongolian t?gr?g | 2                 | .          |

Kindly advise on how to get the special characters inserted as is to the Database? i.e. the symbol not as . but and the description not as Mongolian t?gr?g but Mongolian tögrög. Please help.

Alex Poole
  • 183,384
  • 11
  • 179
  • 318
user2967948
  • 529
  • 2
  • 8
  • 23
  • Sorry about the pl/sql (edited my question now). I would only need an insert query which can allow insert of the special characters into Database. – user2967948 Nov 08 '16 at 11:43
  • You can use `dump()` to see what is actually stored. It might be that your session and/or OS character sets aren't displaying the stored characters properly, rather than them not being stored as you want. What is your database character set, and client, and your NLS_LANG setting (if using SQL\*Plus; or equivalent otherwise), and your OS character set? – Alex Poole Nov 08 '16 at 11:52
  • Which tool do you use to insert/select the data? What is your database `NLS_CHARACTERSET` – Wernfried Domscheit Nov 08 '16 at 12:35
  • NLS_CHARACTERSET - AL32UTF8. I am using SQL*Plus to run the INSERT query. – user2967948 Nov 08 '16 at 13:51

1 Answers1

1

Before you launch your SQL*Plus enter these commands:

chcp 65001
set NLS_LANG=.AL32UTF8
  • The first command sets codepage of cmd.exe to UTF-8.
  • The second command tells your database: "I am using UTF-8"

Then you sql should work. I don't think there is any 8-bit Windows codepage 125x which supports Mongolian tögrög.

See also this post to get some more information: NLS_LANG and others

Check also this discussion how to use sqlplus with utf8 on windows command line, there is an issue when you use UTF-8 at command line.

Community
  • 1
  • 1
Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110