CREATE OR REPLACE PACKAGE AlexMonitor.PKG_RobotManagement
AS
TYPE cursorref is ref cursor;
PROCEDURE GetStationsByRobotID( robotID in AlexMonitor.RobotManagement.Robot_ID%type, out_var out cursorref);
end PKG_RobotManagement;
CREATE OR REPLACE PACKAGE BODY AlexMonitor.PKG_RobotManagement
AS
PROCEDURE GetStationsByRobotID( robotID in AlexMonitor.RobotManagement.Robot_ID%type, out_var out cursorref)
IS
BEGIN
Open out_var for select
Station_ID,
Robot_ID,
STATION.TestStation_ID,
TESTSTATION.TESTSTATION_NAME,
Station_Name,
Station_IP,
Station_Mac_Addr,
Staion_Type
From AlexMonitor.STATION JOIN ALEXMONITOR.TESTSTATION ON STATION.TestStation_ID= TESTSTATION.TestStation_ID where STATION.ROBOT_ID = robotID;
EXCEPTION WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(-10000,'No data found, Please change the condition!');
End GetStationsByRobotID;
END PKG_RobotManagement;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26851211/viewspace-753061/ ,如需转载,请注明出处,否则将追究法律责任。