if temp1 is null then
if temp2 is null then
Result:= 111;
else
Result:=temp2;
end if;
else
Result:=temp1;
end if;
if temp2 is null then
Result:= 111;
else
Result:=temp2;
end if;
else
Result:=temp1;
end if;
解决方案 »
- oracle10g 多实例问题
- 安装的oracle 10问题
- 各位帮忙啊,如何更改NLS中的参数呵
- ORA-01043
- 关于Oracle事务的几个问题,敬请高人指点(急,在线等)
- 请教一下:怎样操作才能把access数剧库和mysql数剧库导入oracle 9i?
- 谁有Redhat Enterprise Linux AS2.1(其他版本也可以)下oracle9i集群配置文档(中英文都可以)
- 请问这个SQL语句如何写?
- 求助,求助!!!
- 在VIEW中可以写触发器吗?如果可以这样的复杂的触发器该怎么写呢?(有点难度)
- 如何将PowerDesigner生成的oracle库表关联起来?急。。。
- 請問這是什么原因
if temp2 is null then
Result:= 111
else Result:=temp2
else Result:=temp1
end if;改为:if temp1 is null then
if temp2 is null then
Result:= 111;
else
Result:=temp2;
end if;
else
Result:=temp1;
end if;
不管这几个参数改成什么,竟然都是得出的同样的值。
针对一组具体参数,一步步分析一下,看应该得到什么,实际得到什么。
单独查一个SQL可以。
/*
函数功能描述:
获得井段数
满足条件的单井的单条钻井取芯中的起始井深到终止井深和
0-1000米
1001-1500米
1501-2000米
2001-2500米
2501-3000米
3001-3500米
3501-4000米
4001-5000米
5001-6000米
6001-7000米
7000米 以上
返回值:井段范围
*/
v_count varchar2(20);--井段范围begin
--Based on the qsjs,choose a course
if as_start<=1000 then
v_count:='0-1000m';
elsif as_start>1000 and as_start<=2500 then
v_count:='1001-2500m';
elsif as_start>2500 and as_start<=3000 then
v_count:='2501-3000m';
elsif as_start>3000 and as_start<=3500 then
v_count:='3001-3500m';
elsif as_start>3500 and as_start<=4000 then
v_count:='3501-4000m';
elsif as_start>4000 and as_start<=4500 then
v_count:='4001-4500m';
elsif as_start>4500 and as_start<=5000 then
v_count:='4501-5000m';
elsif as_start>5000 and as_start<=5500 then
v_count:='5001-5500m';
elsif as_start>5500 and as_start<=6000 then
v_count:='5501-6000m';
elsif as_start>6000 and as_start<=6500 then
v_count:='6001-6500m';
elsif as_start>6500 and as_start<=7000 then
v_count:='6501-7000m';
else
if as_start>7000 then
v_count:='7000m以上';
end if;
end if;
return(v_count);
end f_manage_qxjd;
create or replace function get_value(
omc_id in neobject.omc_id%TYPE,
object_class in neobject.object_class%TYPE)
return objects.int_id%type isResult objects.int_id%type;
temp1 objects.int_id%type;
temp2 objects.int_id%type;
===================================
omc_id和object_class都是传入的参数,要不要in 啊?