在sqlplus下执行
select schema1.table1.field2 from schema1.table1
where schema1.table.field1 = 'aaa';
能不能检索出数据?
select schema1.table1.field2 from schema1.table1
where schema1.table.field1 = 'aaa';
能不能检索出数据?
解决方案 »
- 复杂的求和问题!!
- 求一sql或者过程
- connect as :SYSDBA怎么改为connect as :Normal
- 普通用户登陆时报ora-01033错误怎么解决
- insert 用法 :::::::快救命啊
- ora-12560 错误 请教达人
- 竞赛:查询从某个指定日期到当前日期中间间隔的年、月、日数
- 在VC中如何调用参数个数不确定的存储过程
- 从Oracle里取数据为什么全变成了0x61646D696E6973747261746F7273??
- 关于Oracle.managedDataAccess.dll连接数据库问题
- 新的開始
- 为了create database,用startup nomount pfile="E:\oracle\admin\mydb\pfile\init.ora";错误信息:ORA-01081: 无法启动已在运行的 ORACLE
means no record has been returned from your SQL query.execute
select * from schema1.table1 where schema1.table.field1 = 'aaa';
to see if there is any record.
Exception
when no_data_found then
return;
试试吧
one or none or any.What can i do?用英文说明这件破事真费劲,用中文吧:我不能保证这个select语句肯定可以返回一条记录,是否必须使用
EXCEPTION
when no_data_found then
...去处理?可不敢直接返回,查不到我还有别的事要做呢。
有时能,有时不能,有时会查出好多。(见鬼,赫赫)除了上面的问题,另一个小问题是,如果查出很多,我只想取其中某一个,比如第一个,怎么办?
where id=1;
begin
其它语句;
begin //子块开始
select schema1.table1.field2 into var_temp from (select * from schema1.table1 where schema1.table.field1 = 'aaa' and rownum=1);
exception
when no_data_found then
....
when others then
....
end; //子块结束
其它语句;
end;