我在调用DateTimeSP时遇到问题。我的错误日志:
PLS:00201 identifier 'Call.DateTimeSP' must be declared; statement ignored..
我的通话声明有什么问题,我的格式是对吗?
CREATE OR REPLACE
PROCEDURE "DeviceAssignSP" (iMachine IN VARCHAR2, oDevice OUT VARCHAR2, oRDO OUT VARCHAR2, oRCO OUT VARCHAR2, oUID OUT VARCHAR2, oDate OUT VARCHAR2, oTime OUT VARCHAR2, oSession OUT VARCHAR2, oNow OUT VARCHAR2)
AS
BEGIN
SELECT a.DEVICE_CODE, a.RDO_CODE, a.RCO_CODE, b.USER_ID
INTO oDevice, oRDO, oRCO, oUID
FROM tbl_user_assign_device a
INNER JOIN tbl_user_information b ON a.PERSONNEL_NO = b.PERSONNEL_NO
WHERE DEVICE_CODE = iMachine AND USRDEVICE_STATUS = 'A' AND b.USER_STATUS = 'A' AND a.RDO_CODE = b.RDO_CODE AND rownum <= 1;
IF oRDO IS NULL AND oRCO IS NULL THEN
SELECT a.DEVICE_CODE, '000', '000000', b.USER_ID
INTO oDevice, oRDO, oRCO, oUID
FROM tbl_user_assign_device a
INNER JOIN tbl_user_information b ON a.PERSONNEL_NO = b.PERSONNEL_NO
WHERE DEVICE_CODE = iMachine AND USRDEVICE_STATUS = 'A' AND b.USER_STATUS = 'A' AND rownum <= 1;
ELSIF oRCO IS NULL THEN
SELECT a.DEVICE_CODE, a.RDO_CODE, '000000', b.USER_ID
INTO oDevice, oRDO, oRCO, oUID
FROM tbl_user_assign_device a
INNER JOIN tbl_user_information b ON a.PERSONNEL_NO = b.PERSONNEL_NO
WHERE DEVICE_CODE = iMachine AND USRDEVICE_STATUS = 'A' AND b.USER_STATUS = 'A' AND a.RDO_CODE = b.RDO_CODE AND rownum <= 1;
END IF;
SELECT SEST_VAL
INTO oSession
FROM tbl_session_timeout
WHERE SEST_STATUS = 'A';
Call."DateTimeSP"('DATE', oDate);
Call."DateTimeSP"('TIME', oTime);
Call."DateTimeSP"('NOWFORMAT', oNow);
END;
答案 0 :(得分:1)
您不需要call
从另一个存储过程调用一个存储过程。
CREATE OR REPLACE
PROCEDURE "DeviceAssignSP" (
iMachine IN VARCHAR2,
oDevice OUT VARCHAR2,
oRDO OUT VARCHAR2,
oRCO OUT VARCHAR2,
oUID OUT VARCHAR2,
oDate OUT VARCHAR2,
oTime OUT VARCHAR2,
oSession OUT VARCHAR2,
oNow OUT VARCHAR2)
AS
BEGIN
<<your SQL statements>>
"DateTimeSp"( 'DATE', oDate );
"DateTimeSp"( 'TIME', oTime);
"DateTimeSp"( 'NOWFORMAT', oNow );
END;
由于您似乎是PL / SQL的新手,但有一些评论,但是......
OUT
参数的函数)。