Chinaunix

标题: 请教:JAVA中调用存储过程报284错 [打印本页]

作者: gxm    时间: 2005-08-11 18:17
标题: 请教:JAVA中调用存储过程报284错
跟踪后发现是一条select语句查询结果有重复值。加rowid跟踪发现是两条记录,但其中一条记录不不是满足条件的。

单独执行存储过程没有报错。

单独执行select语句,结果也只有一条记录。

怀疑是不是where语句中的字段名的问题,加了表名还是报284错。

请教各位高手,这是什么原因?先谢谢了。
作者: zzjijun    时间: 2005-08-13 11:57
标题: 请教:JAVA中调用存储过程报284错
是不是在整个应用程序执行过程中动态修改了什么。


-284

__________________________________________________________

A subquery has returned not exactly one row.

A subquery that is used in an expression in the place of a literal value must return only a single row and a single column. In this statement, a subquery has returned more than one row, and the database server cannot choose which returned value to use in the expression. You can ensure that a subquery will always return a single row. Use a WHERE clause that tests for equality on a column that has a unique index. Or select only an aggregate function. Review the subqueries, and check that they can return only a single row.

This error can also occur when you use a singleton SELECT statement to retrieve multiple rows. You must use the DECLARE/OPEN/FETCH series of statements or the EXECUTE INTO statement to retrieve multiple rows.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2