‘ORA-00904: "AGE": invalid identifier’ The association between double quote and case sensitivity
来源:互联网 发布:演唱会软件推荐 编辑:程序博客网 时间:2024/05/16 17:39
异常原因
造成‘ORA-00904: "AGE": invalid identifier’ 的根本原因是数据库不能识别你所给出的列。可能是列名写错了,大小写敏感。以下主要讲解如何解决由大小写敏感造成的这个问题。
A solution from Stack overflow:
Oracle SQL allows us to ignore the case of database object names provided we either create them with names all in upper case, or without using double quotes. If we use mixed case or lower case in the script and wrapped the identifiers in double quotes we are condemned to using double quotes and the precise case whenever we refer to the object or its attributes.
大意阐述:
1.当我们使用全大写加引号或者不在列上使用双引号时创建表的时候,数据库是大小写不敏感的。
全大写加引号:
create table allupper( "NAME" varchar2(8), "AGE" number);select name,AGE from allupper;结果:查询可通过。
不在列上使用双引号:
create table noquote( name varchar2(8), age number);select name,AGE from noquote;结果:查询可通过。
2.如果使用了“”而且列名包含大小写, 那么你必须使用和创建表时一模一样的列名,并且加上“”。
使用了双引号,并且还有大小写
create table mixcase( "NAme" varchar2(8), "Age" number);select name,AGE from mixcase;结果:查询不可通过。ORA-00904: "AGE": invalid identifier
select "NAme","Age" from mixcase;结果:查询可通过。
TIP:
一般我们很少通过表名称的大小写敏感来区分两个表,所以我们应该在创建表的时候尽量不要使用引号。这样就可以做到表名称大小写不敏感。
0 0
- ‘ORA-00904: "AGE": invalid identifier’ The association between double quote and case sensitivity
- MySQL identifier case sensitivity
- Identifier Case Sensitivity
- ORA-00904: : invalid identifier
- ORA-00904::invalid identifier
- ORA-00904:invalid identifier
- ORA-00904: "POLTYP": invalid identifier
- ORA-00904: "POLTYP": invalid identifier
- ORA-00904: “MAXSIZE”: invalid identifier
- ORA-00904: "MAXSIZE": invalid identifier
- ORA-00904: invalid identifier解决方法
- ORA-00904:invalid identifier错误的解决办法
- ORA-00904: "DROP_SEGMENTS": invalid identifier 解决方法
- ORA-00904: "POLTYP": invalid identifier 错误
- 解决ORA-00904: invalid identifier标识符无效
- ORA-00904: invalid identifier标识符无效
- Oracle ORA-00904:invalid identifier 标识符无效
- Escape both single quote and double quote in Smarty
- IOS UIView 渐变色
- Android PackageManager
- tomcat无法识别maven工程
- linux socket 编程(C语言)
- 使用ssh远程重装centos
- ‘ORA-00904: "AGE": invalid identifier’ The association between double quote and case sensitivity
- BZOJ2863: 愤怒的元首
- ROC曲线
- ASI战AFN有甚么差别
- "围观"设计模式(6)--开闭原则(Open/Closed Principle)
- Android中的动画(AlphaAnimation、RotateAnimation、ScaleAnimation、TranslateAnimation)
- Java实现敏感词过滤
- 支付生成二维码和回调地址
- ASI与AFN的区别