Home » SQL & PL/SQL » SQL & PL/SQL » bad binding error on after insert trigger!
bad binding error on after insert trigger! [message #201363] Fri, 03 November 2006 13:31 Go to next message
triggerwf
Messages: 2
Registered: November 2006
Junior Member
CREATE OR REPLACE TRIGGER CMPL_DEV.AFTER_INSERT_T_CI_SECURITY
AFTER INSERT
ON CMPL_DEV.T_CI_SECURITY
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
-- INSERT VALUES IN THE CHILD TABLE T_CI_SECURITYLOG.
INSERT INTO T_CI_SECURITY_LOG (LOG_KEY, LOG_TABLE_ID, LOG_ACTION, LOG_ACTION_BY, LOG_ACTION_DATE,SECURITY_KEY,CI_KEY,CREATED_BY,CREATED_DATE,UPDATED_BY,UPDATED_DATE,SECURITY_DESCRIPTION,SECURITY_SYMBOL)
VALUES(SECURITY_KEY_SEQ.NEXTVAL, 'SECURITY', 'Added',:NEW.CREATED_BY, :NEW.CREATED_DATE,:NEW.SECURITY_KEY,:NEW.CI_KEY,:NEW.CREATED_BY,:NEW.CREATED_DATE,:NEW.UPDATED_BY,:NEW.UPDATED_DATE,:NEW.SECURITY_DES CRIPTION,:NEW.SECURITY_SYMBOL);

END;
/
i get bad bind error on
PLS-00049: bad bind variable for 'NEW.CREATED_BY',NEW.CREATED_DATE, and NEW.CREATED_BY,:NEW.CREATED_DATE,:NEW.UPDATED_BY,:NEW.UPDATED_DATE,:
I have spellchecked the column names, the columns are there in the table t_ci_security_log.
Thankyou in advance for you time and help for looking into this.
Re: bad binding error on after insert trigger! [message #201365 is a reply to message #201363] Fri, 03 November 2006 13:48 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You'll get this error when columns referenced in a trigger do not exist in a table on which the trigger is defined.

I don't know which columns you checked - those in 't_ci_security' table or 't_ci_security_log'. Columns referenced in INSERT statement column list must exist in 't_ci_security_log', while all the ':new' columns must exist in 't_ci_security' table.

Furthermore, check whether you (or someone else) created this table using double quote signs which would make those column names case-sensitive.
Re: bad binding error on after insert trigger! [message #201369 is a reply to message #201365] Fri, 03 November 2006 14:22 Go to previous messageGo to next message
triggerwf
Messages: 2
Registered: November 2006
Junior Member
thanks for the reply. The table t_ci_security does nt have the columns indicated with :new reported as binding error.
But i need to find a way to supply new values to the table t_ci_security_log.
any pointers would be apprecited. thanks.
Re: bad binding error on after insert trigger! [message #201370 is a reply to message #201369] Fri, 03 November 2006 14:35 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In that case, you'll have to decide what to do. Obviously, you can not insert something you don't have.

As you didn't post tables' descriptions, it is kind of difficult to suggest or even guess how to do it. DATE columns *might* be a SYSDATE, for example; CREATED_BY *could* be USER. But, again, it is you who should know what to insert where.
Previous Topic: sql outer join help needed.
Next Topic: Bulk processing features in what Oracle version?
Goto Forum:
  


Current Time: Sun Dec 04 06:24:08 CST 2016

Total time taken to generate the page: 0.08194 seconds