spots
spots

Reputation: 2708

Store "greater than or equal to" symbol in Oracle varchar2 column

I have a varchar2(255) column that I'd like to store a string like:

1 ≤ 2

However, when I run the following sql the ≤ symbol gets turned into a "=".

update my_table set my_column = '1 ≤ 2';

This results in the following value in my table:

1 = 2

How would I store a ≤ or ≥ in the database?

Upvotes: 1

Views: 3885

Answers (1)

Jon Heller
Jon Heller

Reputation: 36817

Use unistr to store UTF8 data. It's not as convenient as a plain string, but it avoids errors caused by clients not interpreting UTF8 correctly.

--≥
select unistr('1 \2265 2') from dual;

--≤
select unistr('1 \2264 2') from dual;

Upvotes: 2

Related Questions