Home » SQL & PL/SQL » SQL & PL/SQL » Need Urgent Help (error in oracle triger (bad binding variable))
Need Urgent Help (error in oracle triger (bad binding variable)) [message #348290] Tue, 16 September 2008 06:23 Go to next message
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
Re: Need Urgent Help (error in oracle triger (bad binding variable)) [message #348294 is a reply to message #348290] Tue, 16 September 2008 06:28 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Are you sure that the columns CHANGED_DATE, ACTION_TYPE, NEXT_STATUS_ID, CHANGED_BY and CHANGE_COMMENTS'exist in the table APPLICANT?
Re: Need Urgent Help (error in oracle triger (bad binding variable)) [message #348303 is a reply to message #348294] Tue, 16 September 2008 06:55 Go to previous messageGo to next message
eng_basem
Messages: 3
Registered: September 2008
Junior Member
you are right ,the fields does not exist in the table (i run old script of the table when i begin working)



thank u very replying
Re: Need Urgent Help (error in oracle triger (bad binding variable)) [message #348309 is a reply to message #348290] Tue, 16 September 2008 06:57 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Read and follow OraFAQ Forum Guide

Regards
Michel
Previous Topic: MV Refresh Not Happen Automatically
Next Topic: array basics
Goto Forum:
  


Current Time: Sat Dec 03 01:23:31 CST 2016

Total time taken to generate the page: 0.11764 seconds