创建存储过程提示对象名无效。
createPROCEDUREtb_p_data_exec@v_set_codevarchar(20)ASBEGIN--1清空临时表数据deletefromA_kmb;(...
create PROCEDURE tb_p_data_exec @v_set_code varchar(20)
AS
BEGIN
--1 清空临时表数据
delete from A_kmb ;(提示A_kmb对象名无效,下同。A_kmb我已经通过select into语句生成到数据库中了,为什么还显示无效呢?)
delete from A_kmyeb ;
delete from A_pzhzhb ;
delete from A_pzhmxb ;
--2 A_kmb表数据处理
insert into A_kmb
select set_code,IN_CODE,DISP_NAME from dbo.ACCOUNTANT_SUBJECT
where set_code=@v_set_code;
--3 A_kmyeb表数据处理
insert into A_kmyeb
select set_code, AS_CODE,BALANCE,fx=case
when left(AS_CODE,1)=1 or left(AS_CODE,1)=5 then
'借' else '贷' end from dbo.REMAIN where set_code=@v_set_code;
--4 A_pzhmxb表数据处理
insert into A_pzhmxb
select set_code, AS_CODE,VOUCHER_ID,SUMMARY,
DEB_MONEY,CRE_MONEY
from dbo.VOUCHER_DETAIL where set_code=@v_set_code;
--5 A_pzhzhb表数据处理
insert into A_pzhzhb
select SET_Code,VOUCHER_ID,SET_YEAR,V_MONTH,
VOUCHER_NO,V_DAY,BILLS from voucher
where set_code=@v_set_code;
commit
END
求解中。。。 展开
AS
BEGIN
--1 清空临时表数据
delete from A_kmb ;(提示A_kmb对象名无效,下同。A_kmb我已经通过select into语句生成到数据库中了,为什么还显示无效呢?)
delete from A_kmyeb ;
delete from A_pzhzhb ;
delete from A_pzhmxb ;
--2 A_kmb表数据处理
insert into A_kmb
select set_code,IN_CODE,DISP_NAME from dbo.ACCOUNTANT_SUBJECT
where set_code=@v_set_code;
--3 A_kmyeb表数据处理
insert into A_kmyeb
select set_code, AS_CODE,BALANCE,fx=case
when left(AS_CODE,1)=1 or left(AS_CODE,1)=5 then
'借' else '贷' end from dbo.REMAIN where set_code=@v_set_code;
--4 A_pzhmxb表数据处理
insert into A_pzhmxb
select set_code, AS_CODE,VOUCHER_ID,SUMMARY,
DEB_MONEY,CRE_MONEY
from dbo.VOUCHER_DETAIL where set_code=@v_set_code;
--5 A_pzhzhb表数据处理
insert into A_pzhzhb
select SET_Code,VOUCHER_ID,SET_YEAR,V_MONTH,
VOUCHER_NO,V_DAY,BILLS from voucher
where set_code=@v_set_code;
commit
END
求解中。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询