一个函数 function getvalue_func(codecode);返回值 varchar2 格式;这个里面codecode=0 报异常no found另一sql 语句调用:
select function getvalue_func(codecode) from tablename
where codetype <> '0';tablename数据存储 都是varchar2 
codetype codecode 
1        2
2        3
0        0其中codecode = ‘0’时 function getvalue_func(codecode) 查不到数据;select function getvalue_func(codecode) from tablename
where codetype <> '0';查询有结果select * from tablename
where codetype <> '0'
and function getvalue_func(codecode) <> '2' ;查询出异常 报异常no found打出来的值 竟然是 codecode =‘0’
崩溃中又试方法:
select * from (select codetype , codecode from tablename
where codetype <> '0')
and function getvalue_func(codecode) <> '2' ;查询出异常 报异常no found
有谁遇见过这种错误?
什么情况的啊。。这是 让我觉得数据库混乱了 
数据库oracle

解决方案 »

  1.   


    select function getvalue_func(codecode) from tablename where codetype <> '0';
    --》
    select getvalue_func(codecode) from tablename where codetype <> '0';select * from tablename
    where codetype <> '0'
    and function getvalue_func(codecode) <> '2' ;
    --》
    select * from tablename
    where codetype <> '0'
    and  getvalue_func(codecode) <> '2' ;调用函数的时候,把function 关键字去掉在试试。 
      

  2.   


    哦 不好意思。。发的时候发激动了 必须不能带 function  发错了 。。手抖了 呵呵 不是这个问题