Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Updating a column on row insert and row update

Okan SutcuogluMar 22 2018 — edited Mar 22 2018

Hello i have over 30 tables that every hable has creation date and last updated columns. I want to update creation date column as today when any insertion happens. Also i want update the last updated column when any updating happens.

What is the quickest way to do that ?

Thank you.

This post has been answered by 875205 on Mar 22 2018
Jump to Answer

Comments

The problem is in processing of check constraints - it seems there is a check constraint without condition. Can you run query for check constraints and to see in what column is the condition and if there is a check constraint without condition

Philip

NISHANTH BEJGAM

Thank you so much Philip. I followed your instruction and by executing the following queries, I see no results returned. and validated the CHECK constraints with conditions as well. Besides, I see couple of constraints are in disabled state in scheme now, please confirm will that cause the issue.
select constraint_name,search_condition from user_constraints where constraint_type='C' and search_condition is NULL;
select constraint_name,search_condition from all_constraints where constraint_type='C' and search_condition is NULL
select constraint_name,search_condition from dba_constraints where constraint_type='C' and search_condition is NULL.

there is one more column SEARCH_CONDITION_VC - can you check it as well?

NISHANTH BEJGAM

all the constraints are having NULL value for SEARCH_CONDITION_VC however SEARCH_CONDITION does has the value in it.

what's the DB version, PDB or CDB?

NISHANTH BEJGAM

it is 12C, PDB

Philip Stoyanov-Oracle

I cannot reproduce in my environment. How those tables and check constraints are created. Do you connect as owner of those tables or you see them through grants and synonyms. Are they in another container/PDB?

1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 19 2018
Added on Mar 22 2018
1 comment
69 views