procedure MoveData is
v_Val varchar2(100);
v_Val1 varchar2(100);
n number;
begin
v_Val:='57102';
v_Val1:='57101';
AddMoveDataToOrignNas(57101,v_Val,v_Val1);
end MoveData;
Compilation errors for PACKAGE BODY AUTH.TESTError: PLS-00221: 'ADDMOVEDATATOORIGNNAS' is not a procedure or is undefined
Line: 94
Text: AddMoveDataToOrignNas(57101,v_Val,v_Val1);
我在头文件中已经定义了AddMoveDataToOrignNas
v_Val varchar2(100);
v_Val1 varchar2(100);
n number;
begin
v_Val:='57102';
v_Val1:='57101';
AddMoveDataToOrignNas(57101,v_Val,v_Val1);
end MoveData;
Compilation errors for PACKAGE BODY AUTH.TESTError: PLS-00221: 'ADDMOVEDATATOORIGNNAS' is not a procedure or is undefined
Line: 94
Text: AddMoveDataToOrignNas(57101,v_Val,v_Val1);
我在头文件中已经定义了AddMoveDataToOrignNas
错误已经指明了,存储过程ADDMOVEDATATOORIGNNAS不存在,可能是你的存储过程名拼写
错了。
或者头文件定义错了,贴出来看一看。
create or replace package body test is v_error_msg varchar2(1000);--??????
v_base_product base_product;--??????
v_executDate executDate := getExecuteDate('Processing');--??????
v_date date := to_date(v_executDate.v_currday,'yyyy-MM');
v_IP varchar2(1000); cursor cur_mobile is -- ??
select a.cityid,a.countyid,a.product, decode(substr(trim(a.loginname),1,3),'133',1,'153',2,'189',3,0) mobiletype,status,to_char(registerdate,'yyyy-MM') as regdate,count(1) cnt
from Auth_Base_UserInfo a where decode(substr(trim(a.loginname),1,3),'133',1,'153',2,'189',3,0) !=0
and registerdate >= v_date and registerdate < add_months(v_date,1)
group by a.cityid,a.countyid,a.product,decode(substr(trim(a.loginname),1,3),'133',1,'153',2,'189',3,0),to_char(registerdate,'yyyy-MM'),status;
-------------------------------- 2:???????(Auth_Report_Mobile) ------------------------------------------------------
procedure init_Auth_Report_Mobile is
v_count number:=0;
begin
--?????????
delete from Auth_Report_Mobile where occurdate = v_date;
--?????????????????????
for mobile in cur_mobile loop
begin
v_count:=v_count+1;
--????,??????,????,?????
v_base_product := getBaseProduct(mobile.product);
exception
when NO_DATA_FOUND then
null;
when DUP_VAL_ON_INDEX then
null;
when others then
null;
end;
--??????????
insert into Auth_Report_Mobile(id,Occurdate,Year,Month,Cityid,Countyid,Usertypeid,Usertype,Linktypeid,Linktype,
Speedid,Speed,Productid,Cnt,status,mobiletype,Createdate,Updatedate,Re,Enabled)
values(auth_report_usermonth_seq.nextval,
to_date(mobile.regdate,'yyyy-MM'),
substr(mobile.regdate,1,instr(mobile.regdate,'-',1)-1),
substr(mobile.regdate,6,instr(mobile.regdate,'-',1)-1),
mobile.cityid,mobile.countyid,
v_base_product.usertypeid,v_base_product.usertype,v_base_product.linktypeid,v_base_product.linktype,
v_base_product.speedid,v_base_product.speed,v_base_product.productid,
mobile.cnt,mobile.status,mobile.mobiletype,sysdate,sysdate,'',1);
--?????
if mod(v_count,v_commit_num)=0 then
commit;
end if; end loop;
commit;
--???? others ??????????,SQLERRM????????????????????
exception
when others then
v_error_msg:='error in init_Auth_Report_Mobile'||SUBSTR(SQLERRM,1,500);
--??????????
insert into auth_log_info(id,name,errorinfo,occdate,re,enabled)
values(auth_log_info_seq.nextval,'init_Auth_Auth_Report_Mobile',v_error_msg,sysdate,'',1);
commit;
end init_Auth_Report_Mobile; /*
* ** ?????,????ID,????,????,?????
*/
function getBaseProduct(productname varchar)return base_product is
v_base_product base_product;
begin
select a.id , a.usertypeid,a.linktypeid,a.speedid , b.listcontent usertype,c.listcontent linktype,d.listcontent speed
into v_base_product.productid,v_base_product.usertypeid,v_base_product.linktypeid,
v_base_product.speedid,v_base_product.usertype,v_base_product.linktype,v_base_product.speed
from Auth_Base_Product a
left join biz_sys_dd b on to_char(a.usertypeid) = b.listvalue and b.listkey='AUTH_USERTYPE' and b.enabled=1
left join biz_sys_dd c on to_char(a.linktypeid) = c.listvalue and c.listkey = 'AUTH_LINKTYPE' and c.enabled=1
left join biz_sys_dd d on to_char(a.speedid) = d.listvalue and d.listkey = 'AUTH_SPEED' and d.enabled=1
where a.enabled=1 and upper(trim(product)) = upper(trim(productname));
-- exception
-- when others then
-- v_product_msg := v_product_msg|| ';'||productname;
return v_base_product;
end getBaseProduct;
function AddMoveDataToOrignNas(node number,vnewNode number,vdomain number) return number is
cursor cur_mobile is -- ??
select ipaddr from auth_base_orignasinfo where upper(trim(domain))=upper(trim(vdomain)); begin
for mobile in cur_mobile loop
insert into auth_base_orignasinfo(id,ipaddr,domain,node,cityid,countyid,orderby,modifydate,enabled,moved) values(Auth_Base_Orignasinfo_SEQ.Nextval,'10.10.10.10','NB-YY-SB-1_domain','57407','3102','310205',32,sysdate,1,1); end loop;
-- exception
-- when others then
-- v_product_msg := v_product_msg|| ';'||productname;
return 1;
end AddMoveDataToOrignNas;
procedure MoveData is
v_Val varchar2(100);
v_Val1 varchar2(100);
n number;
begin
v_Val:='57102';
v_Val1:='57101';
AddMoveDataToOrignNas(57101,1,2);
end MoveData;
end test;// head
create or replace package test is -- Author : SJZ
-- Created : 2009-7-6 9:35:15
-- Purpose : ??????(??????)
type base_product is record(
productid number,--??ID
usertypeid number,--????ID
usertype varchar2(100),--????
linktypeid number,--????ID
linktype varchar2(100),--????
speedid number,--????ID
speed varchar2(100)--????
);
function getBaseProduct(productname varchar
)return base_product;
function AddMoveDataToOrignNas(node number,vnewNode number,vdomain number) return number;
v_commit_num number:=5000;--?????????
procedure init_Auth_Report_Mobile;--???????
-- procedure MoveData;end test;Compilation errors for PACKAGE BODY AUTH.TESTError: PLS-00221: 'ADDMOVEDATATOORIGNNAS' is not a procedure or is undefined
Line: 112
Text: AddMoveDataToOrignNas(57101,1,2);Error: PL/SQL: Statement ignored
Line: 112
Text: AddMoveDataToOrignNas(57101,1,2);
错误很明显了,在这句 AddMoveDataToOrignNas(57101,v_Val,v_Val1); 脚本处,不识别
AddMoveDataToOrignNas存储过程,可能是这个AddMoveDataToOrignNas存储过程没有创建,也许是AddMoveDataToOrignNas存储过程编译失败。楼主应该先去检查下这个AddMoveDataToOrignNas存储过程。
AddMoveDataToOrignNas不是存储过程,是个函数。
AddMoveDataToOrignNas这个函数是编译通过的。
AddMoveDataToOrignNas不是存储过程,是个函数。函数怎么没有返回值?是否执行成功怎么判断,?
进行异常捕捉了?
v_Val varchar2(100);
v_Val1 varchar2(100);
v_ret number;
n number;
begin
v_Val:='57102';
v_Val1:='57101';
v_ret := AddMoveDataToOrignNas(57101,v_Val,v_Val1);
end MoveData;