怎么改。老大,麻烦改一下好吗?我oracle不行啊。

解决方案 »

  1.   

    这个问题本来我已经用java程序搞定了。程序已经写出来了。但跑了一个java程序,因为数据量很大,速度很慢。估计要20个小时才能跑完。所以还是想在oralce中弄。  我原来以为java是万能的。现在 叹!!!慢。。
      

  2.   

    create  or  replace  function  f_con_str_2(v_pk  in  number)  
    return  varchar2  is     
    str_return  varchar2(200); 
    v_11 number;
    v_22 number; 
    cursor  c_str(v_l number,v_2 number)  is  from t_temp where (ABS(v_1- dlongitude)+ABS(v_2- dlatitude))<=0.001;
    begin  
    select  dlatitude,dlongitude into v_11,v_22 from t_temp where pk=v_pk;--这里要通过传入的主键来进行检索,            
    for  str_temp  in  c_str(v_11,v_22)  loop  
    str_return:=str_return||' '||str_temp.strname;  
    end  loop;  
    return  str_return;  
    exception when others
      null;
    end f_con_str_2;  
    /