日期:2014-05-16  浏览次数:21065 次

oracle 存储过程编译报错!请各位高数帮忙看看,小弟在线等待...
SQL code


create or replace procedure P_UpdateMissingParameters(
                                                --输入参数
                                                userOrderId in varchar2 ,       --用户订单ID
                                                InResAttributeCode in varchar2 ,--资源属性编码
                                                insertValue in varchar2         --用户输入的值
                                                --输出参数
                                                --InResTable out varchar2 ,--资源属性表
                                                --InResTableColumn out varchar2--资源属性表字段
                                                 )
/***************************
author:hsh@si-tech.com.cn
date  :2012-02-13
/***************************/
      --定义常量
      is icount                number(8) not null;
         product_id            varchar2(50);             --产品ID 
         net_type_code         varchar2(50);             --连接方式
         in_res_table          varchar2(50);             --资源属性表名称
         in_res_table_pk       varchar2(50);             --资源属性表主键
         in_res_table_column   varchar(50);              --资源属性表字段
         in_busi_res_kind_code varchar2(50);             --业务资源种类编码
        -- fcount             number(8) not null;
         resCount           number(8) not null;
         resId              varchar2(20);                --业务资源ID 
         resKindCount       number(8) not null;
         atom_res_kind_code varchar2(20);                --原子资源种类
         shebeiId         varchar2(20);                  --连接端口设备ID 
         duanziId         varchar2(20);                  --连接端子ID
         cableId          varchar2(20);                  --连接光缆的ID 
         pairId           varchar2(20);                  --连接纤芯的ID 
         luojiId          varchar2(20);                  --逻辑号码ID 
         wuliID           varchar2(20);                  --物理号码ID 


      begin
      --通过用户订单ID查询用户订单表中是否有这条记录
     /* select count(*) into fcount from rt_userorder_info ri where ri.user_order_id=userOrderId;
      if fcount is null then
         fcount:=0;
      end if;*/

      --根据输入参数用户订单ID统计多少条记录
      select count(*) into icount from rt_userorder_info ri where ri.user_order_id=userOrderId;

      if icount=1 then
          --如果通过用户订单ID统计只有一条记录则 查询出产品ID和连接方式
          select ri.product_id,ri.net_type_id into product_id,net_type_code from rt_userorder_info ri where ri.user_order_id=userOrderId;

          --通过产品ID和连接方式查询出 资源属性表名称、资源属性表主键、资源属性表字段、业务资源种类编码
          select rd.in_res_table,
                 rd.in_res_table_pk,
                 rd.in_res_table_column,
                 in_res_kind_code
            into in_res_table,
                 in_res_table_pk,
                 in_res_table_column,
                 in_busi_res_kind_code
            from rt_resreturnconfig_dict rd
           where rd.product_id = product_id
             and rd.net_type_code = net_type_code
             and rd.in_res_attribute_code = InResAttributeCode;
          dbms_output.put_line('更新前资源属性表名称:'||in_res_table);
          dbms_output.put_line('更新钱资源属性表主键:'||in_res_table_pk);
          dbms_output.put_line('更新前资源属性表字段:'||in_res_table_column);
          dbms_output.put_line('更新前业务资源种类编码:'||in_busi_res_kind_code);
       elsif  icount>1 then
           --如果通过用户订单ID统计的总数大于或者等于2条以上记录
          dbms_output.put_line('TOO_MANY_ROWS:一个用户订单ID对应只有一条记录,请核对!');
       else
           dbms_output.put_line('NO_DATA_FOUND:没有找到合法的数据!');

      end if;


      --根据用户订单ID和业务资源种类编码判断是否有记录
      select count(*)
        into resCount
        from rt_workres_info rw
       where rw.user_order_id = userOrderId
         and rw.res_kind_code = in_busi_res_kind_code;

       if resCount=1 then
       --根据用户订单ID和业务资源种类编码查询出业务资源ID (res_id)
          select res_id
            into resId