create or replace procedure PROC_HR_ISNEWUSER(inhandphone in VARCHAR2,
customercode out VARCHAR2,customername out VARCHAR2) is 
begin
declare  customercode VARCHAR2(100);
begin
 customercode :=customercode;
select customercode,customername into customercode,customername 
from t_mc_customer 
where 1=1 ||customercode || inhandphone; 
return; 
end PROC_HR_ISNEWUSER;再通过几天的学习,又有进步了```请问上面什么地方写错了`~!

解决方案 »

  1.   

    create or replace procedure PROC_HR_ISNEWUSER(inhandphone in VARCHAR2, 
    customercode out VARCHAR2,customername out VARCHAR2) is 
    begin 
    customercode VARCHAR2(100); 
    begin 
    customercode :=customercode; 
    select customercode,customername into customercode,customername 
    from t_mc_customer 
    where 1=1 ||customercode || inhandphone; 
    return; 
    end PROC_HR_ISNEWUSER; 
    定义部分不需要些declare的
      

  2.   

    declare和之前的begin不需要,另外customercode变量定义同名,需要改变一个的名字,你的这个SQL语句中用变量来标识字段名,还需要用动态SQL。
      

  3.   

    show error命令可以查看错误
      

  4.   

    where 1=1 ||customercode || inhandphone;   这个是?
      

  5.   

    这个是前面定义的变量customercode ,主要的作用是将customercode付给customercode,然后在SQL中进行查询