Results 1 to 5 of 5

Thread: trigger

  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Unanswered: trigger

    i have 3 tables in my application

    CREATE TABLE "VENDOR_COMPLIANCE_DOCUMENT"
    ( "ID" NUMBER NOT NULL ENABLE,
    "VENDOR_LOCATION" VARCHAR2(500),
    "MONTH_YEAR" VARCHAR2(50),
    "NO_RESOURCES" NUMBER,
    "INSERTED_ON" DATE,
    "LAST_UPDATED_ON" DATE,
    "LAST_UPDATED_BY" VARCHAR2(100),
    "STATUS" VARCHAR2(25),
    "VENDOR_CODE" NUMBER,
    CONSTRAINT "VENDOR_COMPLIANCE_DOCUMENT_PK" PRIMARY KEY ("ID") ENABLE
    ) ;

    CREATE TABLE "COMPLIANCE_DOCUMENT_HISTORY"
    ( "DOCUMENT_ID" NUMBER NOT NULL ENABLE,
    "DOCUMENT_TYPE" VARCHAR2(50),
    "DOCUMENT_RECEIVED_ON" DATE,
    "ID" NUMBER,
    "STATUS" VARCHAR2(50),
    "DISCREPANCY" VARCHAR2(25),
    CONSTRAINT "COMPLIANCE_DOCUMENT_HISTORY_PK" PRIMARY KEY ("DOCUMENT_ID") ENABLE,
    CONSTRAINT "COMPLIANCE_DOCUMENT_HISTORY_UK" UNIQUE ("ID") DISABLE
    ) ;ALTER TABLE "COMPLIANCE_DOCUMENT_HISTORY" ADD CONSTRAINT "COMPLIANCE_DOCUMENT_HISTORY_FK" FOREIGN KEY ("ID")
    REFERENCES "VENDOR_COMPLIANCE_DOCUMENT" ("ID") ENABLE;

    CREATE TABLE "DOCUMENT_DISCREPENCIES"
    ( "DISCREPANCY_ID" NUMBER NOT NULL ENABLE,
    "DOCUMENT_ID" NUMBER,
    "DISCREPANCY_DETAILS" VARCHAR2(50),
    "DISCREPANCY_IDENTIFIED_ON" DATE,
    "DISCREPANCY_CLEARED_ON" DATE,
    "STATUS" VARCHAR2(50),
    CONSTRAINT "DOCUMENT_DISCREPENCIES_PK" PRIMARY KEY ("DISCREPANCY_ID") ENABLE,
    CONSTRAINT "DOCUMENT_DISCREPENCIES_CON" UNIQUE ("DOCUMENT_ID") ENABLE
    ) ;ALTER TABLE "DOCUMENT_DISCREPENCIES" ADD CONSTRAINT "DOCUMENT_DISCREPENCIES_FK" FOREIGN KEY ("DOCUMENT_ID")
    REFERENCES "DOCUMENT_DISCREPENCIES" ("DOCUMENT_ID") ENABLE;


    now i just want to create triggers ,suppose status of 3rd table is cleared then the status of 2nd and first one will automatically update..

    can anyone help me for that..

    thanks....

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >suppose status of 3rd table is cleared

    what exactly does "cleared" mean as far as SQL is concerned?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Oct 2012
    Posts
    3
    actually "cleared" is character message..in this application once you press submit button 3rd table get inserted if there is any discrepancy in the entry..so by default status of 3rd table is "pending"..i created one edit option for the entry with a submit button from that we can edit the discrepancy...

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Oct 2012
    Posts
    3
    thxs alot dude.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •