oracle存储过程中return和exit的区别分析

如题所述

创建或替换程序sp_NewTrip(
ptripID t_Trip.tripid%TYPE,
ptruckID t_Trip.truckid%TYPE,
PDATE t_Trip.tripdate%TYPE,
PMSG出VARCHAR2

AS
v_weektimes数(10),默认为0;
开始
SELECT COUNT(*)到v_weektimes出租车从t_Trip
那里TO_CHAR(PDATE,'yyyyww')= TO_CHAR(tripdate,'yyyyww')和TO_CHAR(PDATE,'YYYY')= TO_CHAR(tripdate,'YYYY')和ptruckID = truckid;
如果(v_weektimes> 4)然后PMSG:='换另一辆卡车';
返回;
其他PMSG:='OK';
END IF;
插入t_Trip
价值观(ptripID,ptruckID,PDATE);
温馨提示:答案为网友推荐,仅供参考
相似回答