`
kb5706
  • 浏览: 40781 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

Oracle/PLSQL: ORA-00913 Error

 
阅读更多

ORA-00913: too many values

。。。。(后面的具体的就不写了)

第一次碰到这样的情况,上网一查才知道:原来sql语句写错了:具体就不说了,主要是一个INSERT语句:结果

VALUES后面的插入的数据比前面的字段名多了一个,所以才出现了所谓的“too many values”错误。



Error:

ORA-00913: too many values

Cause:

You tried to execute an SQL statement that required two sets of equal values, but you entered more items in the second set than was in the first set.

Action:

The options to resolve this Oracle error are:
  1. This error often occurs when you are performing anINSERT statementand enter more values in the VALUES clause than the number of columns that you listed.

For example, if you executed the following INSERT statement:

INSERT INTO suppliers
(supplier_id, supplier_name)
VALUES
(1000, 'Microsoft', 'Bill Gates');

In this example, you've chosen to insert values into 2 columns (supplier_id and supplier_name), but you've entered 3 values (1000, Microsoft, and Bill Gates).

You need to modify your INSERT statement so there are the same number of columns as there are values. For example:

INSERT INTO suppliers
(supplier_id, supplier_name)
VALUES
(1000, 'Microsoft');


  1. This error can also occur when your subquery in the WHERE clause returns too many columns.

For example, if you executed the following SQL statement:

SELECT * FROM suppliers
WHERE supplier_id > 5000
AND supplier_id IN (SELECT * FROM products
WHERE product_name LIKE 'H%);

In this example, the subquery returns all columns from the products table. You need to modify the subquery to return only one column as follows:

SELECT * FROM suppliers
WHERE supplier_id > 5000
AND supplier_id IN (SELECT product_id FROM products
WHERE product_name LIKE 'H%);

文章转自 http://www.techonthenet.com/oracle/errors/ora00913.php

分享到:
评论

相关推荐

    oracle特有的错误:ORA-01036:非法的变量名/编号

    ORA-01036:非法的变量名/编号 oracle特有的错误

    报错ORA01804解决方法.txt

    使用PL/SQL登录ORACLE数据 报错,error while trying to retrieve text for error ORA-01804,的解决方法,操作步骤,在windows server 2008R2 64位,oracle 12C,PLSQL Developer 12 64位,以上使用环境正常,

    Oracle 常见故障解决方法

    oracel 常见 故障 解决 方法

    解决Oracle11g,PL/SQL连接报错问题

    解决Oracle11g,PL/SQL连接报错问题 解压 解压instantclient-basic-nt-11.2.0.2.0.zip,例如到D:\instantclient_11_2 3、设置PLSQL Developer 启动PLSQL Developer,不登录点取消进入PLSQL Developer,Tools->>...

    Oracle用户密码含有特殊字符导致无法登陆解决方法

    今天碰到一个比较奇怪的问题: 在客户端上使用sqlplus用普通用户可以... 本来以为客户端是32位的缘故,就在oracle服务器上用sqlplus登录,也还是一样 SQL> conn system@webdata Enter password: ERROR: ORA-12541: TNS

    plsql连oracle64位 instantclient

    1、解决 不能初始化“xxx”,你确认已经安装了32位Oracle Client 2、解决 ORA-12154:TNS:could not resolve the connect identifier specified (TNS:无法解析指定的连接标识符) 3、不用配置plsql中的OCI路径 4、含...

    最全的oracle常用命令大全.txt

    ORA-01035: ORACLE 只允许具有 RESTRICTED SESSION 权限的用户使用 6、startup force 强制启动方式 当不能关闭数据库时,可以用startup force来完成数据库的关闭 先关闭数据库,再执行正常启动数据库命令 7、...

    plsqldev14.0.6.1988x32多语言版+sn.rar

    Queries on Oracle21c could raise an “ORA-24444: TTC RPC (OALL) not allowed” exception PL/SQL Beautifier could add empty lines after “OPEN cursor” statement Opening the “Roles” folder in the ...

    plsqldev14.0.6.1988x64多语言版+sn.rar

    64位版本的 PLSQL 正式版,只能运行在64位系统中,需要你安装 64 位的 Oracle 客户端。 安装请查看说明。 FEBRUARY 17, 2021 - VERSION 14.0.6 RELEASED Enhancements Note: downloading an update through ...

    PLSQL.Developer v11.0.4.1774 主程序+ v11中文包+keygen

    Viewing job classes on Oracle12c could lead to "ORA-01036: illegal variable name/number" PL/SQL Beautifier did not format FORALL/MERGE loop correctly Test Window now processes trailing slash of a PL/...

    orcale常用命令

    ORA-01035: ORACLE 只允许具有 RESTRICTED SESSION 权限的用户使用 6、startup force 强制启动方式 当不能关闭数据库时,可以用startup force来完成数据库的关闭 先关闭数据库,再执行正常启动数据库命令 7、...

    Toad 使用快速入门

    从网络到性能优化,从备份恢复到Error message,一应俱全 例子:遇到失效的存储过程怎么办? 4. 如何对存储过程进行Debug?  需要Toad单独的Debug Option(Standard Version 没有这个选项)  要用Toad对存储...

Global site tag (gtag.js) - Google Analytics