/*  procedure count_Terminal_Num(terminalType in number,  --终端类型
            orgID in number,                        --组织ID
            sDate in sysdate,                       --安装日期
            countNum out number)                    --数量   
  IS 
    BEGIN 
      CASE terminalType
           when 0 then
              select count(b.rtuid) into :countNum 
              from apowerplant a,artu_cz b 
              where a.cpid=:orgID and a.ppid =b.ppid ;
           WHEN 1 then 
              countNum:=1;  
          ELSE   
              countNum:=0;
      END CASE;
  END count_Terminal_Num; */

解决方案 »

  1.   


    create or replace procedure count_Terminal_Num(terminalType in number, --终端类型 
                                 orgID        in number, --组织ID 
                                 sDate        in sysdate, --安装日期 
                                 countNum     out number) --数量  
     IS
    BEGIN
      CASE terminalType
        when 0 then
          select count(b.rtuid)
            into :countNum
            from apowerplant a, artu_cz b
           where a.cpid = :orgID
             and a.ppid = b.ppid;
        WHEN 1 then
          countNum := 1;
        ELSE
          countNum := 0;
      END CASE;
    END count_Terminal_Num;
      

  2.   

    前面缺少了 create or replace  关键字
      

  3.   

    试了,编译不过去啊,上面的代码是包里定义的,不用加 create or replace  吧!!!
      

  4.   

    有什么错误提示没有?
    select count(b.rtuid) into :countNum 
    from apowerplant a,artu_cz b 
    where a.cpid=:orgID and a.ppid =b.ppid ; 
    改为select 
    select count(b.rtuid) into :countNum 
    from apowerplant a,artu_cz b 
    where a.cpid=:orgID and a.ppid =b.ppid ;countNum,orgID前面多了个冒号
      

  5.   

    sDate in sysdate改成date楼上说的都要改