-1
相關的行號
create or replace TRIGGER R_TRACKER_TRI
before insert on R_TRACKER
for each row
declare
v_number varchar2(15);
begin
if inserting then
:NEW.PROJECT_ID := PROJECT_ID(1);
:NEW.PRO_CREATED := LOCALTIMESTAMP;
:NEW.PRO_CREATED_BY := nvl(v('APP_USER'),USER);
IF :NEW.RECRUITMENT_TYPE= 'New' THEN
SELECT ('NEW/'||TO_CHAR(SYSDATE,'YY') || '/' || (NVL(MAX(SUBSTRB(PROJECT_ID,8)),10000)+1)) into v_number
FROM R_TRACKER
WHERE SUBSTRB(PROJECT_ID,1,3) = 'NEW';
:NEW.PROJECT_ID := v_number;
elsif :NEW.RECRUITMENT_TYPE= 'Replacement' THEN
SELECT ('REP/'||TO_CHAR(SYSDATE,'YY') || '/' || (NVL(MAX(SUBSTRB(PROJECT_ID,8)),10000)+1)) into v_number
FROM R_TRACKER
WHERE SUBSTRB(PROJECT_ID,1,3) = 'REP';
:NEW.PROJECT_ID := v_number;
end if;
INSERT INTO R_TRACKER
(
PROJECT_ID,
PRO_LOC,
DESIGNATION,
NO_OF_POSITION,
VACANCY_SINCE,
STATUS,
REMARKS,
UPLOAD,
RECRUITMENT_TYPE,
APPROVAL,
ACTION
)
VALUES
(
:NEW.PROJECT_ID,
:NEW.PRO_LOC,
:NEW.DESIGNATION,
:NEW.NO_OF_POSITION,
:NEW.VACANCY_SINCE,
:NEW.STATUS,
:NEW.REMARKS
:NEW.UPLOAD,
:NEW.RECRUITMENT_TYPE,
:NEW.APPROVAL,
:NEW.ACTION
);
end if;
end;
感謝您在同我收到PLS-00201的錯誤味精進行補正後洙多Gurv:標識符 'PROJECT_ID' 必須是declaredCompilation失敗,L –
你能確認R_TRACKER裏面有PROJECT_ID嗎? – mmmmmpie