创建了一个function,代码如下:create function find_idno(sn char) return number is
idno number(14);
begin
select id_no into idno from dcustmsg@bossdb where phone_no = sn;
return idno;
end;我想用function 的返回结果作为查询的条件,但不知为何出不来结果?不是没有结果,而是执行了半天sql 也没有执行完.select * from dsrvmsg@bossdb where id_no = find_idno('13994469795');
idno number(14);
begin
select id_no into idno from dcustmsg@bossdb where phone_no = sn;
return idno;
end;我想用function 的返回结果作为查询的条件,但不知为何出不来结果?不是没有结果,而是执行了半天sql 也没有执行完.select * from dsrvmsg@bossdb where id_no = find_idno('13994469795');
id_no上是否有索引,使用函数会禁用索引!
select a.* from dsrvmsg@bossdb a, dcustmsg@bossdb b where a.id_no=b.id_no and b.phone_no='13994469795''