'北京' 在sql语句中的类型是varchar2;
接下来验证一下:
create table province(name nvarchar2(10)); --name的类型是nvarchar2
insert into province values('天府');
insert into province values('国家首都');
select (CASE WHEN name LIKE '%首都%' THEN ('北京')
ELSE (name) END) as name from province; --ORA-12704:字符集不匹配
此处确定'北京'这样的字面值不是NVARCHAR2类型的;
TO_CHAR()把NCHAR, NVARCHAR2, CLOB, NCLOB 转换成VARCHAR2类型;
TO_NCHAR()把CHAR, VARCHAR2, CLOB, NCLOB 转换成NVARCHAR2类型;
select (CASE WHEN name LIKE '%首都%' THEN ('北京')
ELSE to_char(name) END) as name from province; --ok
这句可以确定'北京'是VARCHAR2类型;
下面这句同样不会报错;
select (CASE WHEN name LIKE '%首都%' THEN to_nchar('北京')
ELSE (name) END) as name from province; --ok
分享到:
相关推荐
Literal pool examples on LandTiger
001-glib-gdate-suppress-string-format-literal-warning.patch 001-glib-gdate-suppress-string-format-literal-warning.patch 001-glib-gdate-suppress-string-format-literal-warning.patch
主要介绍了Python EOL while scanning string literal问题解决方法,本文总结出是数据库数据出现问题导致这个问题,需要的朋友可以参考下
论Oracle数据库字符集转换,观点独到,绝对值得一看!
Test that we can make large object literals that work.
Test that we can make large object literals that work.
从mysql读取某一文本数据,付给js变量比如 代码如下:[removed]var strs=”苏润葡萄种植园依托...[removed] 却发现火狐下始终报 unterminated string literal错误。把那段文本复制到txt中打开发现出现了几个黑方块,原来
StringLiteral stringLiteral = ast.newStringLiteral(); stringLiteral.setLiteralValue("中国"); //将其作为引用方法参数 methodInvocation.arguments().add(stringLiteral); //创建变量 ...
The 80x86 MOV Instruction 4.8 - Some Final Comments on the MOV Instructions <br>4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 ...
Test that the clearing of object literal when normalizing objects works.
ts-string-literal-enum-plugin 只需单击一下,即可将枚举转换为字符串文字枚举的工具。 建立 :red_heart_selector: 。用法安装作为VSCode扩展您可以看到 。作为打字稿插件安装套件yarn add ts-string-literal-enum-...
A library with 2 functions. StripChars() removes any ... SplitString() splits a string on one or more individual characters or on an instance of a string contained within the string you want to split.
Status of the book Official Website License Terms Using the interpreter prompt Choosing an Editor Using a Source File Output How It Works Executable Python programs Getting Help Summary 4. ...
and one of the feature of OOP in java is that, we can assign a subclass object or variable to the variable of the superclass type. Log files Log files keeps a records of internet protocol addresses...
Bug with using batch parameters of the Bytes type is fixed Bug with closing a connection that has an active transaction for Firebird 3 is fixed Bug with recreating a connection on Linux and mobile ...
Bug with using batch parameters of the Bytes type is fixed Bug with closing a connection that has an active transaction for Firebird 3 is fixed Bug with recreating a connection on Linux and mobile ...
oracle数据库克隆总结,内容详细具体介绍了步骤
In the other words, if you upgrade one of the installed providers, it may conflict with older builds of other products. In order to continue using the products simultaneously, you should upgrade all ...