ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 對Server表操作的包(8)

對Server表操作的包(8)

原创 Linux操作系统 作者:huangbin7097 时间:2013-01-22 17:13:31 0 删除 编辑

CREATE OR REPLACE  PACKAGE AlexMonitor.PKG_Server
AS
   TYPE cursorref is ref cursor;
   PROCEDURE GetRobotsByServerID(serverID in AlexMonitor.Server.Server_ID%type, out_var out cursorref);
   PROCEDURE GetStationsByServerID(serverID in AlexMonitor.Server.Server_ID%type, out_var out cursorref);
  
 
end PKG_Server;


CREATE OR REPLACE  PACKAGE BODY AlexMonitor.PKG_Server
   AS
   PROCEDURE GetRobotsByServerID(serverID in AlexMonitor.Server.Server_ID%type, out_var out cursorref)
       IS
   BEGIN
  
       OPEN out_var for select
           Robot_ID,
           RT_ID,
           SERVER_ID,
           Robot_Name,
           Robot_IP,
           Robot_Use_State,
           Robot_Port,
           Robot_Expect_Yield,
           Robot_Expect_UPH
        From AlexMonitor.RobotManagement  RM where RM.SERVER_ID = serverID;
     EXCEPTION WHEN NO_DATA_FOUND THEN
            RAISE_APPLICATION_ERROR(-10000,'No data found, Please change the condition!');
    END GetRobotsByServerID; 
  
   PROCEDURE GetStationsByServerID(serverID in AlexMonitor.Server.Server_ID%type, out_var out cursorref)
       IS
   BEGIN
     
    OPEN out_var for select
        Station_ID,
        Station.Robot_ID,
        TestStation_ID,
        Station_Name,
        Station_IP,
        Station_Mac_Addr,
        Staion_Type
       
     From AlexMonitor.STATION JOIN AlexMonitor.ROBOTMANAGEMENT RM ON STATION.ROBOT_ID = RM.ROBOT_ID  where RM.SERVER_ID = serverID;
    EXCEPTION WHEN NO_DATA_FOUND THEN
            RAISE_APPLICATION_ERROR(-10000,'No data found, Please change the condition!');
    END GetStationsByServerID; 


END PKG_Server;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26851211/viewspace-753060/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-04-04

  • 博文量
    59
  • 访问量
    65956