Q
Manage Learn to apply best practices and optimize your operations.

How to solve ORA-04076 error?

I am facing the ORA-04076 error. I googled the error but was unable to understand it. What exactly do I need to do to solve this? I am using Toad.

I am facing the ORA-04076 error. I googled the error but was unable to understand it. What exactly do I need to do to solve this? I am using Toad.
When dealing with triggers, there are pseudovariables called old and new used to reference the state of column data. On a before update, the old.xxxx value is the value of column xxxx before the update, while new.xxxx is the value that will be updated (similar to the after update value). One thing to remember is that on insert, there are no old values, and on delete there are no new values. If I have a before insert trigger and I want to update the create_date column to sysdate, I could try the code below:
if (old.create_date is null) then new.create_date := sysdate; end if;
This will fail because there are no old.xxxx values with an insert. I would need to test the new value.
if (new.create_date is null) then new.create_date := sysdate; end if;
This version will work. Hope this helps.

Dig Deeper on Oracle Application Server

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close