ora-00922-error-message文档
ora-00922-error-message
这个文档有点问题呀
说 这个语句是对的 ,但是他employee_id 的数据类型有问题啊
CREATE table employee
(employee_id(5) NOT NULL, employee_name varchar2(30), employment_length varchar2 (40))
这样把
CREATE table employee
(employee_id varchar2(5) NOT NULL, employee_name varchar2(30), employment_length varchar2 (40))
。。。
全文
ORA-00922
ORA-00922: missing or invalid option is one of many Oracle errors, which does not point to a concrete and easily identifiable problem. The key to resolving this issue is to find the specific location of the error (which can be tedious) and correct its syntax. A small error such as a misplaced comma or missing quotation mark can throw this error. To make things easier, use a good integrated development environment software application to help identify syntactical errors that are hard to catch on your own.
The Problem
ORA-00922: missing or invalid option occurs if an invalid option is specified while defining a storage clause or column. Oracle provides the following information about this error:
Cause: The valid option in specifying a column is NOT NULL to specify that the column cannot contain any NULL values. Only constraints may follow the datatype. Specifying a maximum length on a DATE or LONG datatype also causes this error.
The Solution
Resolving ORA-00922: missing or invalid option can be tricky as the error does not appear due to one, universal cause. Oracle simply states that the syntax must be corrected. The user must remove the erroneous option or length specification from the column or storage specification.
In the following example, a table named employee is created:
CREATE table employee
(employee_id(5) NOT NULL, employee_name varchar2(30) employment_length varchar2 (40))
While this code seems correct at first glance, there is a missing comma after “employee_name varchar2(30),” throwing off the entire code and warranting ORA-00922 error message. The corrected code should read:
CREATE table employee
(employee_id(5) NOT NULL, employee_name varchar2(30), employment_length varchar2 (40))
ORA-00922: missing or invalid option is commonly seen during the installation process, specifically when creating new passwords. It installer may state that the user cannot be created along with the message: “missing or invalid option.” In such cases, the error is likely occurring because you are attempting to create a password that is complex. Changing the password to a less complex, weaker password will allow you to resolve the error and complete the installation successfully. Note that you can change the password to a stronger one after the installation is complete.
Moving Forward
If you continue to face problems with ORA-00920: missing or invalid option, you may consider contacting your database administrator for assistance if you yourself are not the DBA. Another option may be to contact an Oracle professional to resolve the issue. Remember to always check the consultant’s credentials and certification to ensure your Oracle needs are properly met.
ORA-00922
ORA-00922:缺少或无效选项是许多Oracle错误中的一个,它没有指出具体且易于识别的问题。解决这个问题的关键是找到错误的具体位置(这可能会很繁琐)并纠正其语法。一个小错误,如逗号错位或缺少引号,可能会引发此错误。为了让事情变得更简单,使用一个好的集成开发环境软件应用程序来帮助识别您自己很难发现的语法错误。
问题
ORA-00922:如果在定义存储子句或列时指定了无效选项,则会出现缺少或无效选项。Oracle提供了有关此错误的以下信息:
原因:指定列的有效选项不是NULL,以指定该列不能包含任何空值。数据类型后面只能有约束。指定日期或长数据类型的最大长度也会导致此错误。
解决方案
解决ORA-00922:缺少或无效选项可能很棘手,因为错误不会出现是由于一个普遍原因。Oracle只是声明必须纠正语法。用户必须从列或存储规范中删除错误的选项或长度规范。
在以下示例中,创建了名为employee的表:
创建雇员表
(employee_id(5)不为空,employee_name varchar2(30)employment_length varchar2(40))
虽然这段代码乍一看似乎是正确的,但在“employee_name varchar2(30)”之后缺少了一个逗号,从而抛出了整个代码并发出ORA-00922错误消息。更正后的代码应为:
创建雇员表
(employee_id(5)不为空,employee_name varchar2(30),employment_length varchar2
ORA-00922:在安装过程中,尤其是在创建新密码时,通常会看到缺少或无效选项。It安装程序可能会声明无法创建用户,并显示消息:“缺少或无效选项”。在这种情况下,可能会出现错误,因为您试图创建复杂的密码。将密码更改为更简单、更弱的密码将允许您解决错误并成功完成安装。请注意,安装完成后,您可以将密码更改为更强的密码。
前进
如果您继续面临ORA-00920:丢失或无效选项的问题,如果您自己不是DBA,您可以考虑联系数据库管理员寻求帮助。另一种选择可能是联系Oracle专业人员解决问题。请记住始终检查顾问的凭据和认证,以确保您的Oracle需求得到适当满足。