资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

编译时报错:必须在程序包体中对其进行定义?怎么回事?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

全文如下,请各位大侠瞧瞧  
  CREATE   OR   REPLACE   PACKAGE     SP     AS   --返回记录集定义  
                      TYPE   Tphonenumber   is   TABLE   of     Varchar2(20)  
                      INDEX   BY   BINARY_INTEGER;  
                      TYPE   TContent   is   TABLE   of   VARCHAR2(1000)  
                      INDEX   BY   BINARY_INTEGER;  
                      TYPE   TRemark1   is   TABLE   of   VARCHAR2(200)  
                      INDEX   BY   BINARY_INTEGER;  
   
  procedure   SP_ORA(smsmsg   in   varchar2,msgid   in   varchar2,mn   in   varchar2,param   in   varchar2,outmsg   out   Varchar2,phonenumber   out   Tphonenumber,Content   out   TContent,Remark1   out   TRemark1);  
  END   SP;  
   
  CREATE   OR   REPLACE   PACKAGE   BODY     SP     AS  
  procedure   SP_OAR(smsmsg   in   varchar2,msgid   in   varchar2,mn   in   varchar2,param   in   varchar2,outmsg   out   Varchar2,phonenumber   out   Tphonenumber,Content   out   TContent,Remark1   out   TRemark1)     IS    
  percount   NUMBER   DEFAULT   1;    
  tmp   Varchar2(400);  
  pos   number(3);  
  nextpos   number(3);  
  result   Varchar2(100);  
  BusinessDate   Varchar(20);  
  ProductID   Varchar(20);  
  SaleNum   Varchar(20);  
  saleAmon   Varchar(20);  
   
  begin        
          pos   :=   0;  
          nextpos   :=INSTR(smsmsg,   ,pos+1);  
           
          tmp   :=   SUBSTR(smsmsg,pos,nextpos);  
          pos   :=   nextpos+1;  
          nextpos   :=INSTR(smsmsg,#,pos);  
          Businessdate   :=   20||SUBSTR(smsmsg,pos,nextpos-pos);        
          pos   :=   nextpos+1;  
          while   nextpos>0   loop  
              nextpos   :=INSTR(smsmsg,#,pos);  
              ProductID:=   SUBSTR(smsmsg,pos,nextpos-pos);  
              pos   :=   nextpos+1;  
              nextpos   :=INSTR(smsmsg,#,pos);  
              SaleNum:=   SUBSTR(smsmsg,pos,nextpos-pos);  
              pos   :=   nextpos+1;  
              nextpos   :=INSTR(smsmsg,#,pos);  
              if(nextpos   =0)   then  
                      saleAmon   :=   SUBSTR(smsmsg,pos,LENGTH(smsmsg));  
              else  
                      saleAmon:=   SUBSTR(smsmsg,pos,nextpos-pos);  
              end   if;  
              pos   :=   nextpos+1;  
              insert   into   tb_bl_CXKSL   (MobilePhone,ProductID,SaleQuantity,Amount,  
              BusinessDate,SMSDate,msgId)values(mn,ProductID,SaleNum,saleAmon,  
              to_date(BusinessDate,yyyy-mm-dd),sysdate,msgid);  
              nextpos   :=INSTR(smsmsg,-,pos);  
        end   loop;  
        commit;  
  --查询  
        for   each_item   in(select   sum(SaleQuantity)   as   psum   from   tb_bl_CXKSL   group   by   ProductID)  
                loop  
                      phonenumber(percount)   :=   mn;    
                      Content(percount)   :=   each_item.psum;    
                      Remark1(percount)   :=   ;      
                      Percount   =   Percount   +1;    
                end   loop;  
       
  END;  
  END;  
 

网友回答:

发表者:wylwyl1130

搞定就好

发表者:soniczck

对,调用包内的PROCEDURE或是FUNCTION必须加上包名。

发表者:zhaokeke2004

加上包名可以吗?

发表者:biliky

过程名和表名一样都是数据库对象名,其owner名字也是对象名的一部分,所以,一个用户若调用其它用户的数据库对象时必须带上这个对象的用户者的名字。

发表者:jack_4826

没有看出有什么问题!

发表者:David1289

结构如下:schemaname.packagename.functionname


 

 
热门推荐笔记本: 富士通笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved