select * into t_row from table1 where a1='1';
exception
when no_date_found then
...
exception
when no_date_found then
...
解决方案 »
- Oracle登入问题
- 0ralce 816 运行慢,请各位高手支招解决啊
- 时间间隔计算
- PL/SQL跳出的错误
- 已知Oracle数据库a,b,现在在a用户权限下,访问b数据库sql语句为select a.* From b a,请改正这一句Sql的写法
- linux中oracle的问题!
- 求助:CrystalReport for VS.NET + Oracle开发报表时所遇到的问题,在线等,叩谢!!!(没有办法,级别低,分少!)
- 祝大家中秋节快乐!怎么在日志组中增加日志文件??
- 菜鸟问题!如何取得系统时间?
- SQL去重问题
- 在动态SQL中,直接用‘||’构造动态SQL字符串的效率高还是使用BIND_VARIABLE的方法效率高?为什么?
- 请问有谁知道像pl/sql developer 这样的软件是怎么做的?
declare
t_row table1%rowtype;
begin
....
or:
select count(*)
into cnt
from table1
where a1='1';
if cnt > 0 then
...
end if;
使用count(*)是效率很低的。
试试rownum吧。我觉得这个问题使用异常是最好的。
我是问过,我就用的count(*),但是我总觉得不是很好!
to zhoubf725
用rownum怎样实现呢!
into cnt
from table1
where a1='1';
if cnt > 0 then
...
end if;
上面这样写了,这样就行
if cnt>0 then
...
end if;