Skip to Main Content

SQL & PL/SQL

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!

trigger to update a table whenever col status is changed in another table

orton607Apr 8 2010 — edited Apr 8 2010
hello,

Can anyone plz help me out with this issue.

I want to create a trigger which updates the TBL1 CHF_STATUS column and sets it to "DEV" whenever the CHF_STATUS column in TBL2 is
updated from "PRD" to "DEV" for that particular DATASTORE, SCHEMA, TABLE. Below are the table structures and their constraints.



CREATE TABLE TBL1
( "CHF_DATASTORE" VARCHAR2(100) NOT NULL ENABLE,
"CHF_SCHEMA" VARCHAR2(100) NOT NULL ENABLE,
"CHF_TABLE" VARCHAR2(100) NOT NULL ENABLE,
"CHF_STATUS" VARCHAR2(3),
"CHF_STATUS_DT" DATE,
CONSTRAINT "CHF_TABLE_PK" PRIMARY KEY ("CHF_DATASTORE", "CHF_SCHEMA", "CHF_TABLE") ENABLE
)
/


=================================================


CREATE TABLE TBL2
( "CHF_DATASTORE" VARCHAR2(100) NOT NULL ENABLE,
"CHF_SCHEMA" VARCHAR2(100) NOT NULL ENABLE,
"CHF_TABLE" VARCHAR2(100) NOT NULL ENABLE,
"CHF_COLUMN" VARCHAR2(100) NOT NULL ENABLE,
"CHF_BUSINESS_NAME" VARCHAR2(100),
"CHF_STATUS" VARCHAR2(3),
"CHF_STATUS_DT" DATE,

CONSTRAINT "CHF_COLUMN_PK" PRIMARY KEY ("CHF_DATASTORE", "CHF_SCHEMA", "CHF_TABLE", "CHF_COLUMN") ENABLE
)
/

Thanks,
Orton
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2010
Added on Apr 8 2010
2 comments
613 views