Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7019797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:13:57+00:00 2026-05-27T23:13:57+00:00

Ok. So I know how to create a trigger that makes changes to Table

  • 0

Ok. So I know how to create a trigger that makes changes to Table B when an action is made on Table A. that is reletively easy and I am comfortable doing so. What I have been unable to do is to create a trigger that contains an if statement so that it executes if certain criteria are met.

Example:

Table A & Table B are related. Table A contains data concerning documents that are currently in processing which are identified by a unique processing code. Table B contains data about finalized and released documents which are identified by a Publication ID. Table A and Table B are related because a document may undergo many revisions and therefore it may appear multiple times in Table A (unique processing code but same Publication ID) while still only appearing in Table B once. The Publication ID remains the same throughout the course of the document’s life no matter how many revisions it undergoes.

Table A is filled via an input form where people submit requests concerning documents they would like to have us process. They have the option of selecting to process a new document or if they would like to revise a current document that is already in Table B. This is done via a radio group (New, Revision etc…). If ‘Revision’ is selected then a select list box, that is populated with Publication IDs from Table B, appears and the user can select which document to edit.

What I need to do is create a trigger, or some other means, that will, when a request is submitted via our input form, check to see if it is for a revision of a document in Table B and mark the ‘Status’ column in Table B to ‘Revision in Progress’.

So it would need to be either conditionally called or have some kind of if statement in the trigger itself. The condition, again, would be if ‘Revision’ is selected on Table A’s input form then set the Status of the selected Publication ID to ‘Revision in Progress’.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:13:57+00:00Added an answer on May 27, 2026 at 11:13 pm

    It should be normal row level trigger on table A,

    A pseudo code should be something like this..

    create or replace trigger on table A for each row …..
    if :NEW.process_selected = ‘Revision’ then
    update b
    set status = ‘Revision in Progress’
    where publication_id = :publication_id ;
    end if;
    end ;

    -Sanjeev

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a simple application that will let the user
I know the statement: create table xyz_new as select * from xyz; Which copies
I am looking to create timed events which trigger UI changes (like a Toast)
I want to have a database table that keeps data with revision history (like
I have created the follow TSQL trigger that appears to be running forever whenever
All, I am just trying to create a trigger that will pick a whole
I work with SQL Server 2008 R2 I have a simple trigger CREATE TRIGGER
I have a mysql table that is updated through a web page. Some columns
I want to create a trigger that will update the column LastActivityDate to the
What kind of skills should a WPF developer know to create MVVM applications? Things

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.