好像比较麻烦。把tb_busname表中的字段检索出来,再去和你输入的内容匹配oracle好像没有提供这方面的函数可以直接完成你的要求,我是不知道

解决方案 »

  1.   

    select bus_stop from tb_busname where bus_stop = ' &请输入:';
      

  2.   

    create function getvalue(p_input in varchar2)
    return varchar2
    as
    begin
    if instr(p_input,'木材')>1 then
    return '木材厂';
    else
    return '其它厂';
    end if;
    end;
    /select bus_stop from tb_busname where bus_stop=getvalue('输入值');
      

  3.   

    to beckhambobo:
    sorry,你可能理解错了,我需要表中的值作为参数,举个例子:
    有一个存储过程proc_getbusstop(bus_stop in varchar2(20));
    当用户输入诸如木材工厂、香坊木材厂、香坊木材加工工厂等值时,模糊查询程序能识别出来,把这些值当作‘木材厂’来提供给proc_getbusstop,即程序运行proc_getbusstop('木材厂');
    这个要求可以达到吗?谢谢!
      

  4.   

    create procedure getvalue(p_bus_stop in varchar2)
    as
    str varchar2(50);
    begin
    if instr(p_bus_stop,'木材')>1 then
    str:='select * from tb_busname where bus_stop=''木材厂''';
    ...
    else if .....
    ..
    else
    ..
    end if;
    end;
    /