Question

Is it possible to insert the "€" (as a VARCHAR) in a Oracle Database whose character set is : ISO-8859-1 ?

I want to move from ISO-8859-1 to ISO-8859-15 charset (or even WINDOWS-1252 charset will fit) my database in order to store the "€" in my database, but one told me that with a ISO-8859-1 charset for the database, it WOULD BE possible to store directly my "€" char.

So the problem is that for the moment, I am trying to find this solution for the ISO-8859-1 database > There would be a mean to insert the "€" (depending on charset of the clients/drivers/etc., but not depending on the charset of the database)

What is your point of view about that.. ?

If it is true, then why do we have to define a character set for the Oracle database ? One told me that this is just for Oracle "to know how many bytes are needed to encode the character" (and therefore to choose a charset is equivalent to only choose a number of bits for Oracle to encode each character. conclusion: ISO-8859-1 = ISO-8859-15-WINDOWS = 1252 in some ways for Oracle because the number of needed bits are the same...)

I hope I am (almost) clear.. But in my opinion I think that I will never be able to perform an INSERT (with "€") and SELECT and retrieve my "€" on a ISO-8859-1 database...

Thanks for reading me..

(PS: database is 10g version)

Was it helpful?

Solution

The character is not assigned in ISO-8859-1. Therefore there is no way you can represent it. The same byte as in ISE-8859-15 is used to represent ¤ (monetary general symbol).

Source

Oracle needs knowing in what character set it will encode the database for the following purposes:

  • Know on how many bytes to store each character
  • Being able to perform conversions when the clients NLS are different (some client is sending a query in UTF-8, with data that is valid ISO-8859-1: Oracle can translate it).
  • Packages that analyze column contents (like full text search) are sensitive to what character it is.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top