How to insert Indian Rupee symbol in oracle 11g?(如何在 oracle 11g 中插入印度卢比符号?)
问题描述
我想在 oracle 11g 中插入印度卢比符号.
我试过了:
插入货币(名称,符号)值('卢比',unistr('20B9'));但它不起作用.
SELECT ascii('₹') FROM dual; 它给出了卢比符号的 ascii 值,但插入后它会在行中显示框.
在这里你可以看到
SELECT chr(14844601) FROM dual;似乎只需要在 SQL Developer 中更改字体即可.检查使用 oracle.jdbc.convertNcharLiterals 属性开启相同的行为,该属性作用于系统和连接级别.
要打开此属性,请在 SQL Developer 安装文件夹的 sqldeveloperidein 目录中找到 ide.conf 文件,并将此行添加到文件末尾:>
AddVMOption -Doracle.jdbc.convertNcharLiterals=true保存文件并重新启动 SQL Developer,现在一切都必须正常工作:
附言说明基于SQL Developer Version 3.2,旧版本可能有其他配置文件位置.例如.sqldeveloperinsqldeveloper.conf .
I want to insert Indian Rupee symbol in oracle 11g.
I have tried:
insert into currency(name, symbol) values ('rupee', unistr('20B9'));
but its not working.
SELECT ascii('₹') FROM dual; it gives ascii value for Rupee symbol but after insert it shows box in the row.
here you can see
SELECT chr(14844601) FROM dual;
Seems that you just need to change a font in SQL Developer. Check this SQLFiddle.
There are two things wrong in your question text: to get unicode symbol from it's code nchr() function must be used instead of chr(). Second is that '₹' constant string treated as varchar2 and to properly specify nvarchar2 constant you must prepend N to this literal: N'₹' .
To change font just open Tools -> Preferences ... menu
and choose Code Editor -> Fonts node. At this page you can select font from Font Name dropdown list. Copy and past rupee symbol into Sample Text field to quickly see if font are acceptable.
Arial (on win7) works fine for me:
This setting changes grid font as well as font in code editor:
Actions above puts you only to a half of the way to get full rupee symbol support because select N'₹' from dual will return only question sign. This is because of query text encoding conversion done between client and server side.
To deal with this issue Oracle provides ORA_NCHAR_LITERAL_REPLACE environment setting. This setting guides client API to analyze query text for character constants prefixed with N and use special internal format to encode such a data on client side before transferring query text to server. Unfortunately SQL Developer uses Thin JDBC API which ignores this environment setting, so adding this environment variable doesn't solve a problem.
But there are another way to turn on same behavior with oracle.jdbc.convertNcharLiterals property which acts on a system and connection levels.
To turn this property on, locate ide.conf file in sqldeveloperidein directory in SQL Developer installation folder and add this line to the end of a file:
AddVMOption -Doracle.jdbc.convertNcharLiterals=true
Save file and restart SQL Developer, all things must work now:
P.S. Instructions based on SQL Developer Version 3.2, old versions may have another location of configuration file. E.g. sqldeveloperinsqldeveloper.conf .
这篇关于如何在 oracle 11g 中插入印度卢比符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 oracle 11g 中插入印度卢比符号?
基础教程推荐
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 在 SQL 中连接多个表 2021-01-01
