- 浏览: 113310 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (99)
- weblogic (2)
- websphere (8)
- log4j (2)
- request (1)
- session (2)
- keytool (2)
- oracle (22)
- Js (5)
- servlet (2)
- Hibernate (2)
- java (1)
- Myeclipse (1)
- 理论 (5)
- utils (1)
- Tomcat (10)
- SQL Server (3)
- CXF (1)
- iframe (2)
- 服务器 (1)
- Ehcache (1)
- Nginx (5)
- 代理服务器 (2)
- Linux (5)
- Redis (1)
- keepalived (4)
- MySQL (1)
- Arcgis Server (1)
- 文件管理 (0)
- BI工具 (1)
- Excel (2)
最新评论
-
ccakcc:
{name: '列名称',index: '列名称',width ...
jqGrid单元格内容设置字体颜色
Reserved words and keywordsare identifiers that have special meaning in PL/SQL.
You cannot use reserved words as ordinary user-defined identifiers. You can use them as quoted user-defined identifiers, but it is not recommended. For more information, see"QuotedUser-Defined Identifiers".
You can use keywords as ordinary user-defined identifiers,but it is not recommended.
不能使用保留字作为用户定义的变量。但是当加上双引号就可以,但是不推存。
关键字就可以作为用户定义的变量,但是不推存。
举例子:
(1)保留字
-- number
创建表,作为字段名。
SQL> CREATE TABLE cux_oyj_RESERVED_WORDS(NUMBER NUMBER);
CREATE TABLE cux_oyj_RESERVED_WORDS(NUMBER NUMBER)
ORA-00904: : 标识符无效
加上双引号,就可以
SQL> CREATE TABLE cux_oyj_RESERVED_WORDS("NUMBER" NUMBER);
Table created
但是查询:
SQL> SELECT rw.number from cux_oyj_RESERVED_WORDS rw;
SELECT rw.number from cux_oyj_RESERVED_WORDS rw
ORA-01747: user.table.column, table.column 或列说明无效
使用起来比较麻烦。
(2)关键字
--name
创建表,作为字段名。
SQL> CREATE TABLE cux_oyj_KEYWORDS(NAME VARCHAR2(50));
Table created
保留字与关键字的视图(动态视图)V$RESERVED_WORDS
This view gives a list of all SQL keywords. To determine whether a particular keyword is reserved in any way, check the RESERVED, RES_TYPE, RES_ATTR, and RES_SEMI columns.
Column Datatype Description
KEYWORD VARCHAR2(30) Name of the keyword
LENGTH NUMBER Length of the keyword
RESERVED VARCHAR2(1) A value of Y means that the keyword cannot be used as an identifier. A value of N means that it is not reserved.
RES_TYPE VARCHAR2(1) A value of Y means that the keyword cannot be used as a type name. A value of N means that it is not reserved.
RES_ATTR VARCHAR2(1) A value of Y means that the keyword cannot be used as an attribute name. A value of N means that it is not reserved.
RES_SEMI VARCHAR2(1) A value of Y means that the keyword is not allowed as an identifier in certain situations, such as in DML. A value of N means that it is not reserved.
DUPLICATE VARCHAR2(1) A value of Y means that the keyword is a duplicate of another keyword. A value of N means that it is not a duplicate.
保留字:
Begins with: Reserved Words
A
ALL, ALTER, AND, ANY, AS, ASC, AT
B
BEGIN, BETWEEN, BY
C
CASE, CHECK, CLUSTERS, CLUSTER, COLAUTH, COLUMNS, COMPRESS, CONNECT, CRASH, CREATE, CURSOR
D
DECLARE, DEFAULT, DESC, DISTINCT, DROP
E
ELSE, END, EXCEPTION, EXCLUSIVE
F
FETCH, FOR, FROM, FUNCTION
G
GOTO, GRANT, GROUP
H
HAVING
I
IDENTIFIED, IF, IN, INDEX, INDEXES, INSERT, INTERSECT, INTO, IS
L
LIKE, LOCK
M
MINUS, MODE
N
NOCOMPRESS, NOT, NOWAIT, NULL
O
OF, ON, OPTION, OR, ORDER, OVERLAPS
P
PROCEDURE, PUBLIC
R
RESOURCE, REVOKE
S
SELECT, SHARE, SIZE, SQL, START, SUBTYPE
T
TABAUTH, TABLE, THEN, TO, TYPE
U
UNION, UNIQUE, UPDATE
V
VALUES, VIEW, VIEWS
W
WHEN, WHERE, WITH
关键字:
Begins with: Keywords
A
A, ADD, AGENT, AGGREGATE, ARRAY, ATTRIBUTE, AUTHID, AVG
B
BFILE_BASE, BINARY, BLOB_BASE, BLOCK, BODY, BOTH, BOUND, BULK, BYTE
C
C, CALL, CALLING, CASCADE, CHAR, CHAR_BASE, CHARACTER, CHARSET, CHARSETFORM, CHARSETID, CLOB_BASE, CLOSE, COLLECT, COMMENT, COMMIT, COMMITTED, COMPILED, CONSTANT, CONSTRUCTOR, CONTEXT, CONTINUE, CONVERT, COUNT, CURRENT, CUSTOMDATUM
D
DANGLING, DATA, DATE, DATE_BASE, DAY, DEFINE, DELETE, DETERMINISTIC, DOUBLE, DURATION
E
ELEMENT, ELSIF, EMPTY, ESCAPE, EXCEPT, EXCEPTIONS, EXECUTE, EXISTS, EXIT, EXTERNAL
F
FINAL, FIXED, FLOAT, FORALL, FORCE
G
GENERAL
H
HASH, HEAP, HIDDEN, HOUR
I
IMMEDIATE, INCLUDING, INDICATOR, INDICES, INFINITE, INSTANTIABLE, INT, INTERFACE, INTERVAL, INVALIDATE, ISOLATION
J
JAVA
L
LANGUAGE, LARGE, LEADING, LENGTH, LEVEL, LIBRARY, LIKE2, LIKE4, LIKEC, LIMIT, LIMITED, LOCAL, LONG, LOOP
M
MAP, MAX, MAXLEN, MEMBER, MERGE, MIN, MINUTE, MOD, MODIFY, MONTH, MULTISET
N
NAME, NAN, NATIONAL, NATIVE, NCHAR, NEW, NOCOPY, NUMBER_BASE
O
OBJECT, OCICOLL, OCIDATE, OCIDATETIME, OCIDURATION, OCIINTERVAL, OCILOBLOCATOR, OCINUMBER, OCIRAW, OCIREF, OCIREFCURSOR, OCIROWID, OCISTRING, OCITYPE, OLD, ONLY, OPAQUE, OPEN, OPERATOR, ORACLE, ORADATA, ORGANIZATION, ORLANY, ORLVARY, OTHERS, OUT, OVERRIDING
P
PACKAGE, PARALLEL_ENABLE, PARAMETER, PARAMETERS, PARENT, PARTITION, PASCAL, PIPE, PIPELINED, PRAGMA, PRECISION, PRIOR, PRIVATE
R
RAISE, RANGE, RAW, READ, RECORD, REF, REFERENCE, RELIES_ON, REM, REMAINDER, RENAME, RESULT, RESULT_CACHE, RETURN, RETURNING, REVERSE, ROLLBACK, ROW
S
SAMPLE, SAVE, SAVEPOINT, SB1, SB2, SB4, SECOND, SEGMENT, SELF, SEPARATE, SEQUENCE, SERIALIZABLE, SET, SHORT, SIZE_T, SOME, SPARSE, SQLCODE, SQLDATA, SQLNAME, SQLSTATE, STANDARD, STATIC, STDDEV, STORED, STRING, STRUCT, STYLE, SUBMULTISET, SUBPARTITION, SUBSTITUTABLE, SUM, SYNONYM
T
TDO, THE, TIME, TIMESTAMP, TIMEZONE_ABBR, TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TRAILING, TRANSACTION, TRANSACTIONAL, TRUSTED
U
UB1, UB2, UB4, UNDER, UNSIGNED, UNTRUSTED, USE, USING
V
VALIST, VALUE, VARIABLE, VARIANCE, VARRAY, VARYING, VOID
W
WHILE, WORK, WRAPPED, WRITE
Y
YEAR
Z
ZONE
You cannot use reserved words as ordinary user-defined identifiers. You can use them as quoted user-defined identifiers, but it is not recommended. For more information, see"QuotedUser-Defined Identifiers".
You can use keywords as ordinary user-defined identifiers,but it is not recommended.
不能使用保留字作为用户定义的变量。但是当加上双引号就可以,但是不推存。
关键字就可以作为用户定义的变量,但是不推存。
举例子:
(1)保留字
-- number
创建表,作为字段名。
SQL> CREATE TABLE cux_oyj_RESERVED_WORDS(NUMBER NUMBER);
CREATE TABLE cux_oyj_RESERVED_WORDS(NUMBER NUMBER)
ORA-00904: : 标识符无效
加上双引号,就可以
SQL> CREATE TABLE cux_oyj_RESERVED_WORDS("NUMBER" NUMBER);
Table created
但是查询:
SQL> SELECT rw.number from cux_oyj_RESERVED_WORDS rw;
SELECT rw.number from cux_oyj_RESERVED_WORDS rw
ORA-01747: user.table.column, table.column 或列说明无效
使用起来比较麻烦。
(2)关键字
--name
创建表,作为字段名。
SQL> CREATE TABLE cux_oyj_KEYWORDS(NAME VARCHAR2(50));
Table created
保留字与关键字的视图(动态视图)V$RESERVED_WORDS
This view gives a list of all SQL keywords. To determine whether a particular keyword is reserved in any way, check the RESERVED, RES_TYPE, RES_ATTR, and RES_SEMI columns.
Column Datatype Description
KEYWORD VARCHAR2(30) Name of the keyword
LENGTH NUMBER Length of the keyword
RESERVED VARCHAR2(1) A value of Y means that the keyword cannot be used as an identifier. A value of N means that it is not reserved.
RES_TYPE VARCHAR2(1) A value of Y means that the keyword cannot be used as a type name. A value of N means that it is not reserved.
RES_ATTR VARCHAR2(1) A value of Y means that the keyword cannot be used as an attribute name. A value of N means that it is not reserved.
RES_SEMI VARCHAR2(1) A value of Y means that the keyword is not allowed as an identifier in certain situations, such as in DML. A value of N means that it is not reserved.
DUPLICATE VARCHAR2(1) A value of Y means that the keyword is a duplicate of another keyword. A value of N means that it is not a duplicate.
保留字:
Begins with: Reserved Words
A
ALL, ALTER, AND, ANY, AS, ASC, AT
B
BEGIN, BETWEEN, BY
C
CASE, CHECK, CLUSTERS, CLUSTER, COLAUTH, COLUMNS, COMPRESS, CONNECT, CRASH, CREATE, CURSOR
D
DECLARE, DEFAULT, DESC, DISTINCT, DROP
E
ELSE, END, EXCEPTION, EXCLUSIVE
F
FETCH, FOR, FROM, FUNCTION
G
GOTO, GRANT, GROUP
H
HAVING
I
IDENTIFIED, IF, IN, INDEX, INDEXES, INSERT, INTERSECT, INTO, IS
L
LIKE, LOCK
M
MINUS, MODE
N
NOCOMPRESS, NOT, NOWAIT, NULL
O
OF, ON, OPTION, OR, ORDER, OVERLAPS
P
PROCEDURE, PUBLIC
R
RESOURCE, REVOKE
S
SELECT, SHARE, SIZE, SQL, START, SUBTYPE
T
TABAUTH, TABLE, THEN, TO, TYPE
U
UNION, UNIQUE, UPDATE
V
VALUES, VIEW, VIEWS
W
WHEN, WHERE, WITH
关键字:
Begins with: Keywords
A
A, ADD, AGENT, AGGREGATE, ARRAY, ATTRIBUTE, AUTHID, AVG
B
BFILE_BASE, BINARY, BLOB_BASE, BLOCK, BODY, BOTH, BOUND, BULK, BYTE
C
C, CALL, CALLING, CASCADE, CHAR, CHAR_BASE, CHARACTER, CHARSET, CHARSETFORM, CHARSETID, CLOB_BASE, CLOSE, COLLECT, COMMENT, COMMIT, COMMITTED, COMPILED, CONSTANT, CONSTRUCTOR, CONTEXT, CONTINUE, CONVERT, COUNT, CURRENT, CUSTOMDATUM
D
DANGLING, DATA, DATE, DATE_BASE, DAY, DEFINE, DELETE, DETERMINISTIC, DOUBLE, DURATION
E
ELEMENT, ELSIF, EMPTY, ESCAPE, EXCEPT, EXCEPTIONS, EXECUTE, EXISTS, EXIT, EXTERNAL
F
FINAL, FIXED, FLOAT, FORALL, FORCE
G
GENERAL
H
HASH, HEAP, HIDDEN, HOUR
I
IMMEDIATE, INCLUDING, INDICATOR, INDICES, INFINITE, INSTANTIABLE, INT, INTERFACE, INTERVAL, INVALIDATE, ISOLATION
J
JAVA
L
LANGUAGE, LARGE, LEADING, LENGTH, LEVEL, LIBRARY, LIKE2, LIKE4, LIKEC, LIMIT, LIMITED, LOCAL, LONG, LOOP
M
MAP, MAX, MAXLEN, MEMBER, MERGE, MIN, MINUTE, MOD, MODIFY, MONTH, MULTISET
N
NAME, NAN, NATIONAL, NATIVE, NCHAR, NEW, NOCOPY, NUMBER_BASE
O
OBJECT, OCICOLL, OCIDATE, OCIDATETIME, OCIDURATION, OCIINTERVAL, OCILOBLOCATOR, OCINUMBER, OCIRAW, OCIREF, OCIREFCURSOR, OCIROWID, OCISTRING, OCITYPE, OLD, ONLY, OPAQUE, OPEN, OPERATOR, ORACLE, ORADATA, ORGANIZATION, ORLANY, ORLVARY, OTHERS, OUT, OVERRIDING
P
PACKAGE, PARALLEL_ENABLE, PARAMETER, PARAMETERS, PARENT, PARTITION, PASCAL, PIPE, PIPELINED, PRAGMA, PRECISION, PRIOR, PRIVATE
R
RAISE, RANGE, RAW, READ, RECORD, REF, REFERENCE, RELIES_ON, REM, REMAINDER, RENAME, RESULT, RESULT_CACHE, RETURN, RETURNING, REVERSE, ROLLBACK, ROW
S
SAMPLE, SAVE, SAVEPOINT, SB1, SB2, SB4, SECOND, SEGMENT, SELF, SEPARATE, SEQUENCE, SERIALIZABLE, SET, SHORT, SIZE_T, SOME, SPARSE, SQLCODE, SQLDATA, SQLNAME, SQLSTATE, STANDARD, STATIC, STDDEV, STORED, STRING, STRUCT, STYLE, SUBMULTISET, SUBPARTITION, SUBSTITUTABLE, SUM, SYNONYM
T
TDO, THE, TIME, TIMESTAMP, TIMEZONE_ABBR, TIMEZONE_HOUR, TIMEZONE_MINUTE, TIMEZONE_REGION, TRAILING, TRANSACTION, TRANSACTIONAL, TRUSTED
U
UB1, UB2, UB4, UNDER, UNSIGNED, UNTRUSTED, USE, USING
V
VALIST, VALUE, VARIABLE, VARIANCE, VARRAY, VARYING, VOID
W
WHILE, WORK, WRAPPED, WRITE
Y
YEAR
Z
ZONE
发表评论
-
Oracle密码过期 怎么修改
2016-10-09 10:36 4831、查看用户的proifle是哪个,一般是default: s ... -
解决Oracle 11g在用EXP导出时,空表不能导出
2016-06-23 15:17 431一、问题原因: 11G中有个新特性,当表无数据时,不分 ... -
ORA-01950: no privileges on tablespace xxxx
2016-06-21 09:00 859案例场景: 新建了一个表空间后TBS_MARKET_DAT ... -
oracle中用户删除不了,提示“无法删除当前已连接的用户”
2016-06-20 16:53 8141.alter user XXX account lock ... -
数据库中的字段和Java里面的类型匹配
2015-12-04 11:49 943当在hibernate中运用原始的sql语句进行操作的的时候, ... -
Oracle查询表结构的SQL语句
2015-05-07 16:24 39041. 查询表结构基本信息 select * ... -
pl sql developer 中文乱码
2015-04-14 16:22 4901、新建变量,设置变量名:NLS_LANG,变量值:SIMP ... -
Oracle OS认证、口令文件、密码丢失处理
2015-01-26 20:30 664一、OS认证 1、OS认证介绍 Oracle安装之后默认 ... -
Win 7 下PL/SQL Developer无法连接64位Oracle 11gR2
2014-11-26 16:52 667前言: plsql developer无法连接ora ... -
Win 7 下Navicat无法连接64位Oracle 11gR2:Cannot load OCI DLL解决方法
2014-04-22 15:01 1370错误描述:在Win7下安装了Oracle 1 ... -
ORACLE EXP/IMP的使用详解
2013-03-20 19:47 777ORACLE EXP/IMP的使用详解 ... -
oracle中exp,imp的使用详解
2013-03-20 19:46 624oracle中exp,imp的使用详 ... -
Oracle 错误一览表
2013-03-20 16:32 944Oracle 错误一览表 ORA-00001: 违 ... -
oracle 错误集锦
2013-03-20 16:02 887oracle 错误集锦 一、解决ORA-12560: TN ... -
JAVA调用Oracle存储过程
2013-01-09 16:50 909JAVA调用Oracle存储过程 JAVA跟Oracle之间最 ... -
ORACLE PL/SQL 存储过程教程
2013-01-07 14:32 1001(1)SEQNAME.NEXTVAL里面的值如何读出来?可以直 ... -
如何查看Oracle的用户权限
2013-01-05 14:35 908ORACLE数据字典视图的种类分别为:USER,ALL 和 ... -
oracle 操作记录
2013-01-05 14:35 779一、授权 1、赋予create session的权限 gra ... -
Oracle创建表空间、创建用户、授权、授权对象的访问以及查看权限集合
2013-01-05 14:35 994CREATE TABLESPACE tab_ckbdata d ... -
Oracle存储过程基本语法
2013-01-05 14:35 845存储过程 1 CREATE OR REPLACE PRO ...
相关推荐
在Oracle数据库系统中,关键字或保留字是用来执行特定功能和操作的预定义标识符。这些关键字对于编写有效的SQL语句至关重要,因为它们帮助开发者构建出清晰、逻辑严谨的数据库查询与管理指令。本文将详细介绍Oracle...
Oracle保留字列表包括: * AND * ANY * AS * ASC * AUDIT * Authorization * BEGIN * BETWEEN * BY MySQL保留字 MySQL是一种开源的关系数据库管理系统。MySQL的保留字主要包括以下几个方面: * 数据定义语言...
在MySQL 5.7中,了解关键字和保留字对于编写有效的SQL语句至关重要。这些关键字是SQL语言中具有特殊含义的单词,它们用于定义数据库结构、查询数据、更新记录等操作。保留字则是那些不能直接作为数据库对象名称(如...
在上面的代码中,我们使用ResultMap来处理Oracle关键字,例如"STARTTIME"和"ENDTIME"等。这可以避免MyBatis中的关键字冲突,从而解决错误问题。 总结 在本文中,我们讨论了如何解决MyBatis中使用Oracle关键字出错的...
1. **避免使用Oracle保留字和关键字**:在创建数据库对象时,应避免使用Oracle预定义的保留字和关键字,如LEVEL和TYPE,以防止语法冲突。 2. **命名约定**:表名、视图名、索引名、序列名、主键和外键名都有明确的...
Oracle保留字和关键字请参考视图V$RESERVED_WORDS。在代码中,对于脚本代码块的书写,需要采用缩进风格,确保代码清晰易读;在多行书写情况下,第一行的关键字应当右对齐,以增强代码的可读性。 上述知识点涵盖了从...
### Oracle关键字用法整合 #### 1. CONCAT **功能说明**:`CONCAT`用于连接两个或多个字符串。在Oracle中,可以使用`||`作为替代方式。 **示例**: ```sql SELECT CONCAT('%','') FROM dual; ``` 在示例中,由于`...
在Oracle数据库中,保留字和关键字是编程和SQL查询中至关重要的元素。保留字是数据库系统特有的一组词汇,它们在语法上有特殊含义,不能用作标识符(如表名、列名),因为它们已经被系统占用以执行特定的操作。例如...
命名规则还要求避免使用 Oracle 的保留字和关键字。各表之间相关列名尽量同名,且命名只能使用英文字母、数字和下划线。 二、表名规则 表名规则要求使用英文单词或词组作为表名,不得使用汉语拼音。表名规则还要求...
2. 使用明确的别名,避免使用单个字符作为别名,以防与保留字冲突。 3. 在可能的情况下,使用标准SQL语法,以提高代码的移植性。 4. 当遇到兼容性问题时,查阅数据库的官方文档以获取正确的语法和用法。 总的来说,...
这些关键字和保留字在进行SQL编程时需要特别注意,避免与它们发生冲突。列表中包括了像`ABORT`、`ABSTRACT`、`ACCESSED`等关键字以及带星号标识的保留字,例如`*ABSOLUTE`、`*ADD`等。 通过以上分析可以看出,尽管...
避免使用Oracle的保留字和关键字,如level和type。相关列名尽量保持一致。数据库的命名应反映其用途和站点,例如"OLPS"或"BOPS"加上站点的简写。索引命名应包含表名、列名和类型,序列则以"seq_"开头加上表名。 ...
"Oracle Reserved Words, Keywords, and Namespaces.mht"文件则专注于Oracle的保留字、关键字和命名空间。保留字是SQL语言中具有特殊含义的词汇,不能用于表、列或变量的命名;关键字用于定义数据库对象和操作;而...
关键字变色是这些设置的一部分,它有助于快速识别和区分不同的语法元素,如数据类型、保留字、函数名等。下面我们将深入探讨这个主题: 1. **配置文件**:在PLSQL Developer中,个人设置保存在用户目录下的`.plsql...
- 避免使用Oracle的保留字和关键字,如`LEVEL`、`TYPE`等。 - 相关表格的列名应尽量保持一致。 - 命名长度限制:数据库名称1-8个字符,其他对象1-30个字符,数据库链接不超过30个字符。 - 只能使用英文字母、...
- 避免使用Oracle的保留字和关键字,如`LEVEL`和`TYPE`,以防止与内置功能冲突。 - 相关表格之间的列名应该保持一致,以便于理解它们之间的关系。 - 命名长度有特定限制,例如数据库名称为1-8个字符,其他对象为1...
此外,为了防止将来再次出现此类问题,建议在创建新的数据库对象时,遵循良好的命名规范,比如使用下划线分隔的驼峰式命名法,避免使用保留字,并确保名字具有描述性。同时,使用Oracle的`DESCRIBE`命令或数据库设计...
此外,命名应该反映对象的实际含义,避免使用Oracle的保留字和关键字,如"LEVEL"和"TYPE"。 对于数据库和System Identifier (SID)的命名,全局数据库名和SID应当保持一致,且两者都不能包含特殊字符,如下划线"_"。...