/*--@author: lijy--@function: Information check procedure for employee entry--@parr: P_urid is the ID of workshop operation account, foreground is obtained by {U_urid} global parameter*/CREATE OR REPLACE ProcedureEsp_staffcheck (p_idinteger, P_uridinteger, P_retval outinteger) asP_compidinteger; P_iInteger; E_exception exception;BeginP_retval:=0; P_i:=0; SelectCompid intoP_compid fromEstaff_registerwhereId=p_id; --The data has been confirmed! Select Count(1) intoP_i fromDualWhere Exists(Select 1 fromEstaff_registerWhereId=p_id andNVL (Initialized,0)=1) ; IfP_i= 1 ThenP_retval:=910000; Raise E_exception; End if ; --savepoint UpdateEstaff_registerSetInitialized= 1, Initializedby=P_urid, Initializedtime=sysdateWhereId=p_id; Commit; Exception whenE_exception Then Null; whenOthers ThenP_retval:= -1; Dbms_output.put_line (SQLERRM);EndEsp_staffcheck1;
Standard Simple SP Template