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 4014462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:30:00+00:00 2026-05-20T09:30:00+00:00

Trying to create an Oracle trigger that runs after a table is updated in

  • 0

Trying to create an Oracle trigger that runs after a table is updated in any way. I’ve been googling this all morning and came up with this:

CREATE OR REPLACE TRIGGER gb_qty_change
AFTER UPDATE OR INSERT OR DELETE ON F_ITEM_STORE
FOR EACH ROW
DECLARE
  v_qty V_AD_ON_HAND%rowtype;
  v_isbn TD_ITEM_DESCRIPTION.TD_IDENTIFIER%type;
BEGIN
    delete from gb_transaction where gb_tide = :new.ITST_ITEM_TIDE_CODE;
    select TD_IDENTIFIER INTO v_isbn from TD_ITEM_DESCRIPTION where TD_TIDE = :new.ITST_ITEM_TIDE_CODE;
    select * INTO v_qty from V_AD_ON_HAND where ITST_ITEM_TIDE_CODE = :new.ITST_ITEM_TIDE_CODE;
    insert into gb_transaction(gb_tide, gb_isbn, gb_used_on_hand, gb_new_on_hand)
      values(:new.ITST_ITEM_TIDE_CODE, v_isbn, v_qty.USED_ON_HAND, v_qty.NEW_ON_HAND);
END;
/

I’m trying to keep it to a single record per TIDE_CODE in the new table.

V_AD_ON_HAND is a view that pulls an inventory count.
gb_transaction is my new table where I’m logging these events

Comparing it to other peoples code it looks like it should run but I’m getting “Warning: Trigger created with compilation errors.”

  • 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-20T09:30:00+00:00Added an answer on May 20, 2026 at 9:30 am

    The problem, I believe is with the :new designations for a delete trigger. There is, after all, no NEW value as the record is expunged. You can only access the :OLD values on delete.

    if you section the trigger by operation, you can do this.

    CREATE OR REPLACE TRIGGER gb_qty_change 
    AFTER UPDATE OR INSERT OR DELETE ON F_ITEM_STORE 
    FOR EACH ROW 
    DECLARE   
       v_qty V_AD_ON_HAND%rowtype;   
       v_isbn TD_ITEM_DESCRIPTION.TD_IDENTIFIER%type; 
    BEGIN 
      IF INSERTING or UPDATING then
        ... insert your existing code
      ELSE
        ... do something similar with the :old values for the deleting case
      end if;
    END;
    /
    

    Incidentally, it is generally helpfull if you tell us WHAT the error is, not just that you had one. If compiling via SQL*Plus script, after the forward slash call to compile the trigger after the “end;” statement, add a line that says:

    SHOW ERRORS TRIGGER YOUR_TRIGGER_NAME;

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

Sidebar

Related Questions

I am trying to create a report in SSRS2000 that will query an ORACLE
I have Oracle 10gR2. I am trying to create autoincrement trigger. Here is the
Trying to create a sequence in Oracle that starts with the max value from
So I'm new to Oracle, trying to create a table as follows: create table
I'm importing Oracle data into SQL Server. After my OLE DB Source that runs
I am trying create a WCF service that leverages the WPF MediaPlayer on the
Trying to create my first iPhone app that would play back audio. When I
Trying to create a small monitor application that displays current internet usage as percentage
i'm trying to make a TRIGGER in ORACLE using ORACLE SQL DEVELOPER, I would
I am trying to create an update statement in Oracle. Here it is version

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.