|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
过程编译没错,调用时报错rep-1401.严重的PL/SQL错误
PROCEDURE INSERT_JIAOYI IS
CURSOR CU_1 IS
SELECT GHV.DEFAULT_EFFECTIVE_DATE DEFAULT_DATE -----栏位:有效时间
, SUBSTR(GHV.BATCH_NAME,1,12) TNAME -----栏位:总帐号码
, GHV.DOC_SEQUENCE_VALUE DOC -----栏位:传票号码
, GHV.DESCRIPTION DTION -----栏位:摘要
, GJV.ACCOUNTED_DR DR -----栏位:借项金额
, GJV.ACCOUNTED_CR CR -----栏位:贷项金额
, GJV.JE_LINE_NUM NUM -----栏位:分录NO
, GJV.CONTEXT3 CONTEXT3 -----栏位:科目
FROM GL_JE_HEADERS_V GHV
, GL_JE_LINES_V GJV
, GL_CODE_COMBINATIONS_V GCV
WHERE GHV.JE_HEADER_ID =GJV.JE_HEADER_ID
AND GJV.STATUS='P' ------条件:过账:STATUS=P
AND GJV.CODE_COMBINATION_ID= GCV.CODE_COMBINATION_ID
AND GCV.SEGMENT1 between SUBSTR( _FLEX_FM,1,3) AND substr(:P_FLEX_TO,1,3)
AND GCV.SEGMENT2 between SUBSTR(:P_FLEX_FM,5,6) AND substr(:P_FLEX_TO,5,6)
AND GCV.SEGMENT3 between SUBSTR(:P_FLEX_FM,12,2) AND substr(:P_FLEX_TO,12,2)
AND GCV.SEGMENT4 between SUBSTR(:P_FLEX_FM,15,5) AND substr(:P_FLEX_TO,15,5)
AND GCV.SEGMENT5 between SUBSTR(:P_FLEX_FM,21,6) AND substr(:P_FLEX_TO,21,6)
-- AND TO_CHAR(GHV.DEFAULT_EFFECTIVE_DATE,'YYYY/MM/DD HH24:MI:SS') between :M_YXDT_B AND :M_YXDT_E
ORDER BY CONTEXT3,DOC;
LR_1 CU_1%ROWTYPE;
BEGIN
DELETE FROM TEMP_LEON;
:M_NO:=1;
OPEN CU_1;
LOOP
FETCH CU_1 INTO LR_1;
EXIT WHEN CU_1%NOTFOUND;
:M_NO := :M_NO +1 ;
INSERT INTO TEMP_LEON
( TNO
,DEFAULT_EFFECTIVE_DATE
,TNAME
,DOC_SEQUENCE_VALUE
,DESCRIPTION
,ACCOUNTED_DR
,ACCOUNTED_CR
,JE_LINE_NUM
,CONTEXT3
)VALUES
(:M_NO
,LR_1.DEFAULT_DATE -----栏位:有效时间
,LR_1.TNAME -----栏位:总帐号码
,LR_1.DOC -----栏位:传票号码
,LR_1.DTION -----栏位:摘要
,LR_1.DR -----栏位:借项金额
,LR_1.CR -----栏位:贷项金额
,LR_1.NUM -----栏位:分录NO
,LR_1.CONTEXT3 -----栏位:科目
);
END LOOP;
commit;
CLOSE CU_1;
END;
通过PL/SQL测试过,CU_1里有数据,将其中一比数据INSERT到表里是可以的,可是在REPORT里就报错。
在BEFORE_REPORT里调用包错REP-1401有严重的PL/SQL错误。
function BeforeReport return boolean is
BEGIN
SELECT NVL(TO_CHAR(START_DATE,'YYYY/MM/DD HH24:MI:SS'),TO_CHAR(SYSDATE,'YYYY/MM/DD HH24:MI:SS'))
,NVL(TO_CHAR(END_DATE,'YYYY/MM/DD HH24:MI:SS'),TO_CHAR(SYSDATE,'YYYY/MM/DD HH24:MI:SS'))
INTO :M_YXDT_B,:M_YXDT_E
FROM GL_PERIODS WHERE PERIOD_NAME=:P_KJQJ AND ROWNUM <2;
INSERT_JIAOYI();
--INSERT_YUE();
--COMPUTE_DATA();
RETURN (TRUE);
end;
请高手帮忙!!! |
|