Need Urgent Help (error in oracle triger (bad binding variable)) [message #348290] |
Tue, 16 September 2008 06:23  |
eng_basem
Messages: 3 Registered: September 2008
|
Junior Member |
|
|
i compile the following triger and give some errors:
CREATE OR REPLACE TRIGGER T_ChangeApplicantStatus AFTER UPDATE ON applicant
FOR EACH ROW
DECLARE
OldStatus VARCHAR2(10);
NewStatus VARCHAR2(10);
ApplicantID VARCHAR2(10);
RequisitionId VARCHAR2(10);
ChangedDate DATE;
NextStatus VARCHAR2(10);
ChangedBy VARCHAR2(10);
Changecomments VARCHAR2(150);
ActionType VARCHAR2(1);
BEGIN
OldStatus := :old.status_id;
NewStatus := :new.status_id;
IF OldStatus Is Null THEN
OldStatus := '';
END IF;
IF NewStatus Is Null THEN
NewStatus := '';
END IF;
IF OldStatus <> NewStatus THEN
Begin
ApplicantID := :new.applicant_id;
RequisitionId := :new.requisition_id;
ChangedDate := :new.changed_date;
ActionType := :new.action_type;
NextStatus := :new.next_status_id;
ChangedBy := :new.changed_by;
Changecomments := :new.change_comments;
If Not (ActionType is Null) then
Begin
If ActionType = 'R' Or ActionType = 'D' then
Begin
RequisitionId := :old.requisition_id;
End;
End IF;
Insert Into applicanct_status_history
(applicant_id,
status_id,
requisition_id,
changed_date,
next_status_id,
changed_by,
comments,
action_type)
Values
(ApplicantID,
NewStatus,
RequisitionId,
ChangedDate,
NextStatus,
ChangedBy,
Changecomments,
ActionType);
End;
End IF;
End;
End IF;
END;
The errors is:
Compilation errors for TRIGGER OHRTEST.T_CHANGEAPPLICANTSTATUS
Error: PLS-00049: bad bind variable 'NEW.CHANGED_DATE'
Line: 27
Text: ChangedDate := :new.changed_date;
Error: PLS-00049: bad bind variable 'NEW.ACTION_TYPE'
Line: 28
Text: ActionType := :new.action_type;
Error: PLS-00049: bad bind variable 'NEW.NEXT_STATUS_ID'
Line: 29
Text: NextStatus := :new.next_status_id;
Error: PLS-00049: bad bind variable 'NEW.CHANGED_BY'
Line: 30
Text: ChangedBy := :new.changed_by;
Error: PLS-00049: bad bind variable 'NEW.CHANGE_COMMENTS'
Line: 31
Text: Changecomments := :new.change_comments;
any advice to help me please
|
|
|
|
|
|